How to make a specific Common Event before victory?

Basically what the title says: I need a Common Event to play after the last enemy is defeated but before battle results are shown, NOT on the map after battle. I'm using Visustella Plugins if there's anything there to make it easier.
better make it a troop event, and even then you'll need plugins. But the fun ction for base troop events is in the battle core

Does it have to be before battleresults? it would be much easier if it could be triggered after battle.

If you need it before, then my method will need nine base troop events, one run on turn 0 to give every enemy an immortal state and eight (one per enemy) checking if that enemy has HP=0 and if yes, call the common event before removing the immortal state.
better make it a troop event, and even then you'll need plugins. But the fun ction for base troop events is in the battle core

Does it have to be before battleresults? it would be much easier if it could be triggered after battle.

If you need it before, then my method will need nine base troop events, one run on turn 0 to give every enemy an immortal state and eight (one per enemy) checking if that enemy has HP=0 and if yes, call the common event before removing the immortal state.
I should specify now since it deals with remaining enemies, sorry.
In effect, I'm making an invincible enemy that is to "disappear" after all other enemies are defeated (using Visustella Action Sequence), so yeah it needs to be before results and I'm not sure HP checks can help...

Edit: I should also add that the enemies that aren't the invincible one are using Visustella's Enemy Swap so using HP checks is definitely not going to work...
Is this the behavior you're looking for?
oy vey.jpg
Eli/Hakuen Studios has a plugin that lets you trigger a switch or run a common event from inside a window so you can try it from the Victory Text window, or if you need it before then try to find another battle text window to hook it onto

I'm making an invincible enemy that is to "disappear"
That is exactly what the immortal state is about - the immortal state (=resist death state) wil prevent the enemy from being killed.
My previous comments about HP=0 was for cases when the enemy was not supposed to be immortal so that the state would be removed the moment the HP drops to zero but after the event commands, in order to prevent the battleend coming first.

But if it is about an invincible enemy, then the other enemies don't need the immortal state - have the immortal state on the invincible enemy only, but still one HP=0 triggered troop event for every other enemy, counting if all are dead and only remove the immortal state from the invincible enemy (and add a kill or escape command for it) when all regular enemies are gone
I've found a workaround mostly using the Battle A.I. plugin from Visustella; I've had it so if the invincible enemy is the only one left it will use a fleeing technique. Not what I was particularly looking for, but it'll have to do for now.

Thanks for the ideas and suggestions everyone~
Is there any reason you aren't just using my (admittedly dumb, brute-force) approach? You could have the battle end any way you want.
Don't know where exactly to post it so excuse me in advance... I have a problem with 2 messages one right after another after my party loses the battle. What could it be? Please, help. I have my brains broken already. Ah, I'm using RMMV 1.6.1.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-make-a-specific-common-event-before-victory.158796/