Detect Open Window (aqara) - Reduce Temperature by Wiser

This is not necessary and in fact you should avoid importing Java stuff into JS scripts when using openhab-js.

Replace with

var setPointValue = Quantity("5 °C");

More details in the docs at JavaScript Scripting - Automation | openHAB

Similarly, this is not necessary and you should either use console.

Replace with

console.loggerName = "org.openhab.core.automation.examples"; // changing the name of the logger is optional
console.info("a77476452e -SetPoint Value: " + setPointValue);

More details in the docs at JavaScript Scripting - Automation | openHAB

Threshold Alert and Open Reminder [4.0.0.0;4.9.9.9] can be used to detect if window1 or window2 or door are open longer than 5 minutes. Or you can implement this with a timer. See Design Pattern: Motion Sensor Timer for how to do this with a timer.

For close put all three Items into a Group with an aggregation function “all closed else open”. Trigger your rule using this Group Item changed state to closed.