how to close current choises or textboxes player might have on screen

Im making a common event based on a random timer,
I want this event to close all other possible visible choiseboxes or text. I have tried to search for a solution but could not get any good results. Anyone here know of a way? thanks 🙂
@Martin Not certain there is an easier way than to manipulate the message window itself.

Here is what I used in a parallel common event (I used switch #8 to activate the event) :

Code:
◆If:Timer ≤ 0 min 0 sec
  ◆Script:var window = SceneManager._scene._messageWindow;
  :      :
  :      :window.initMembers();
  :      :window.terminateMessage();
  :      :window.subWindows().forEach(function(subwindow) {
  :      :  subwindow.close();
  :      :  subwindow.deactivate();
  :      :});
  ◆Control Timer:Stop
  ◆Control Switches:#0008 parallelEvent = OFF
  ◆
:End

Here is the javascript code by itself :

Code:
var window = SceneManager._scene._messageWindow;

window.initMembers();
window.terminateMessage();
window.subWindows().forEach(function(subwindow) {
  subwindow.close();
  subwindow.deactivate();
});
Thank you! 😀 That was very nice of you

Original thread: https://forums.rpgmakerweb.com/threads/how-to-close-current-choises-or-textboxes-player-might-have-on-screen.114113/