Need help with a common event that happen when you die off battle.

Alright, hello. First time posting here. I don't know if i'm in the right place to post that, if i'm not, sorry.
Anyway, My game has a lot of traps and enemies that attack you, kind of like an A-RPG. However, i want my character to play an animation when the state "Death" is applied. I tried a conditional Branch, but to no avail. If anybody has an answer, it would be really nice to share it.
Thanks.
You have to check if the death state is going to be applied BEFORE applying it and play the animation if that is the case. When the death state is applied you get the Game Over screen so there is nothing you can do once you apply it.

P.S. You posted in the right place
Thanks for answering. Another question, though. How do i check beforehand?
If all damage sources are evented, you could do the check before those events hurt the player.. Like, compare the current HP of the player with the damage to be dealt by the event.. If player's HP is less than or equal to that amount, run your custom death event right away, dont even do the damage part or apply the death state as that will make it go to the game over scene..
Ahhh ! I understand now, thanks!
Also do not forget to put eventual damage reduction modifiers in your formula when you check if the attack is going to deal enough damage to kill the player. Basically what you want to check is not the damage itself but the damage it would inflict to the player so if the player has 50% resistance to that element you have to check if that damage multiplied by 0.5 is enough to kill the player.
It seems to be evented "damage" though which is probably using Change HP, so I guess he's all good.. But yeah, in case that damage reductions shall apply, he needs to check those too.

Original thread: https://forums.rpgmakerweb.com/threads/need-help-with-a-common-event-that-happen-when-you-die-off-battle.106557/