Force a choices window to close with a script call

I apologize since I think this has been asked before, but it looked like an older threat.


Say someone wants to make a choices window timed, or simply get affected by a parallel event. How does one call the cancel handler with a script call?


I'm guessing it has something to do with this function, but I'm having syntax trouble with calling it for a currently open choices window:


Window_ChoiceList.prototype.callCancelHandler = function() {


$gameMessage.onChoice($gameMessage.choiceCancelType());


this._messageWindow.terminateMessage();


this.close();


};


I think this could have a ton of utility. I hope we can figure it out together and benefit everyone!
I haven't tested this at all, but try:

Code:
$gameMessage.onChoice(n)

where n is the index of the cancel option (or whichever option you want to be chosen when the timeout happens), keeping in mind the top one is probably index 0.
Thanks for the suggestion, but unfortunately that doesn't appear to work. I tried both from another parallel event and within the same event with no luck.
Hime has you covered 😀
Hime has you covered 😀
How so?
I have the same need.
If you're referring to a plugin can you link me to it?
Googling "hime timed choices" has a plugin that does exactly that as the first result:

Was that really so hard that it was necessary to necro-post in a 6 year old thread?
Googling "hime timed choices" has a plugin that does exactly that as the first result:

Was that really so hard that it was necessary to necro-post in a 6 year old thread?
I don't want a timer, I want to force close a show choices on command.
It might have that feature though.
I actually did do several different google searches and looked through several threads and none of them seemed to have what I was looking for.

edit : looks like it does have the feature I needed, thankyou

Original thread: https://forums.rpgmakerweb.com/threads/force-a-choices-window-to-close-with-a-script-call.61512/