HP drops to 0 Event Not Working

This is super frustrating and I've been trying for hours. I want an event to trigger when the player dies in this certain troop, but when they do so, it takes you straight to the Game Over screen. I've looked at examples, and it seems in order to do this you need to disable the death state when the player hits 0, but I can't for the life of me figure out how or find anything online. Plz help. Very sad.
This concerns only the last enemy alive - the troop event will work as intended for all other cases, the only problem is that the death of the last enemy will trigger game over before the events are processed.

There are two possible ways around this, and you got the first one backward.
1) give all enemies the immortal state (immunity to death) at first battle turn and remove that state after the HP=0 troop event has processed

2) use a plugin to get additional troop event triggers like "trigger at battleend".
Didn't even know the immortal state was a thing! Thanks so much 😅
The "Immortal state" approach could work in theory, but since you don't want your actors to be immune to Death in general, you'd have to do some really complex eventing to toggle the Death state on/off manually after checking whether the event should run and deciding that it shouldn't (because, for example, other allies are still alive). For that reason, I recommend either using a script or changing the code yourself if you're well-versed in Ruby.

This script is very good and should meet your needs: Hime's End Phase Triggers Probably the best way to use it is to do so in conjunction with Hime's Page Conditions script, and use a condition like $game_party.all_dead?

Original thread: https://forums.rpgmakerweb.com/threads/hp-drops-to-0-event-not-working.93591/