MZ What script would I use to check if a window is open?

What line of code could I use as a condition in Hud Maker Ultra to check if x window is open?
generally youd look at the current scene with
Code:
SceneManager._scene
and then check the ".visible" property of the window in question, but each window is given its own name when its added as a property to the scene.
Youd have to look into the code that creates the window within the scene or poke around in the console to get the property name for the window.
I think it would be easier to "flip" the problem. Bind the window's visibility to a Switch and use this one to control.

Original thread: https://forums.rpgmakerweb.com/threads/what-script-would-i-use-to-check-if-a-window-is-open.174854/