MZ How to force abort a message and choice process after timer?

So I'm making an event that triggers when the timer reaches a certain value. So far, I can get the event to trigger via parallel + autorun processing.

But I fail to make it override any message/choice process. I want the timer event to start even if the player is in the midst of talking to an NPC or doing choices.

The plan was as follows:
  1. Player started a timer countdown for 2 mins.
  2. Player has to find items during the 2 mins.
  3. Also within 2 mins, player has to answer a series of choices (quizzes). If the player answers all the quizzes correctly, they can avoid game over. If they answered 1 question wrong, it will reduce 10 seconds from the timer.
  4. If the 2 mins ran out, a short dialogue will play out immediately, overriding whatever the player was doing, and leads to a game over.
At first, I managed to make the timer event override a message box by utilizing VisuStella Message Core MZ fast-forward using the
JavaScript:
Input._currentState["pagedown"] = true;
It works to an extent, but once I get the choice window to the mix, it doesn't work anymore.

I assume I could do the same by just forcing a choice to be selected, as to 'skip' the choice window. But I don't know how to actually make it work. I tried this
JavaScript:
choiceWindow.select(0);
choiceWindow.processOk();
but it keeps waiting for input.

Some solutions I tried for a workaround and I wish to avoid:
  1. Triggering the timer event after the previous event processing (the messages etc) which is done automatically by RPGMZ. I assumed if player ran out of timer in the middle of the quiz but finished the quiz correctly, then there's no need for a timer to begin with.
  2. Calling a common event that checks if timer runs out after each message. While this may be tedious and could work, it would make the timer's impact less, since the sense of urgency is gone. (might consider this if I have no other choices)
  3. Making the timer pause when there's a dialogue. Again, would kill the sense of urgency and make timers redundant.
  4. Making the quiz/NPC dialogues a parallel process. While this could also work, if the event is the quiz/choices, it wouldn't skip and still wait for input.
Is there any way I could make this work with script calls? Or if any plugins are available to override events like this?

P.S. for the eventing, here's what I did for
The timer checker Common Event (using EliMZ_Timer)
1747235277027.png


The Timer Over Common Event
1747235341009.png


I can provide any other necessary information if needed.
Thanks in advance.
It's in script call list:

SceneManager._scene._messageWindow.terminateMessage();

SceneManager._scene._choiceListWindow.processOk();

EDIT: Oh and if instead of force select you wanted, cancel, it's:

SceneManager._scene._choiceListWindow.processCancel();
It's in script call list:

SceneManager._scene._messageWindow.terminateMessage();

SceneManager._scene._choiceListWindow.processOk();

EDIT: Oh and if instead of force select you wanted, cancel, it's:

SceneManager._scene._choiceListWindow.processCancel();
That works, even when the choices were set to disable cancel via event. Thank you!

Original thread: https://forums.rpgmakerweb.com/threads/how-to-force-abort-a-message-and-choice-process-after-timer.177671/