Encounter battle ends when outside timer runs out?

Hey hey!

So I have a puzzle that I just got to work pretty well, where the player has a set of buttons that when one is pressed, the player must run across the map and flip a switch of the same color before time runs out. An obstacle for the player comes in the form of enemy encounters that will appear every now and again that costs the player their time to flip the other switch. however, instead of the time just running out in the background, it stops the battle along with resetting the puzzle.

Is there a way to keep this from happening?

Thank you!
What does the switch do? As in, what happens to start the timer? It may help to see the setup of your events to further help you out.

I assume you have a timer set up where it triggers a reset of all the events.
What does the switch do? As in, what happens to start the timer? It may help to see the setup of your events to further help you out.

I assume you have a timer set up where it triggers a reset of all the events.
Yes, so basically you push a button which starts the timer. To solve/complete the puzzle, you have to flip an in-game switch that basically the other half to the puzzle. When the second switch is pulled, it stops the timer and adds a variable to an "amount of systems reset" variable I have set (I have four of these puzzles all together).
Is there a way to keep this from happening?
This might work for you
Yes, so basically you push a button which starts the timer. To solve/complete the puzzle, you have to flip an in-game switch that basically the other half to the puzzle. When the second switch is pulled, it stops the timer and adds a variable to an "amount of systems reset" variable I have set (I have four of these puzzles all together).
I meant showing the actual window with the events. Post a screenshot and I'll see if I can help out.

Original thread: https://forums.rpgmakerweb.com/threads/encounter-battle-ends-when-outside-timer-runs-out.161237/