Question regarding battle end/win condition during battle

So, using the default battle system, I tried to implement a sort of "wave" system. Whereas, when you defeat all enemies on screen new spawn in the same battle. Sadly, this doesn't work, because as soon as all enemies are dead the battle turns to the "You won!" screen.

Do I actually need a plugin for this or can I somehow "force" the system to play out battle events even when all on screen enemies are dead?

I am currently trying to turn switches for living enemies of as soon as they die. Once several switches are off the second wave would spawn. But as said, as soon as the last living enemy dies, the battle ends and nothing in the events is processed anymore.
no, it can be done without a plugin

you'll need one troop event on turn zero that gives all enemies an "immortal" state where they are immune to the death state.
then you'll need one troop event for every enemy triggered on HP=0. That troop event should do whatever should happen when the enemy dies, and remove the immortal state as the last command.

that way the enemy only dies after the troop event has run, and the battleend sequence will only happen if the last troop event doesn't add new enemies
Well, a bit complicated, but it works. Thanks!

Original thread: https://forums.rpgmakerweb.com/threads/question-regarding-battle-end-win-condition-during-battle.125727/