Play animation on death?

I'd like an animation to play on an enemy upon death - not something like a custom animation of an enemy falling over, but just a basic effekseer animation, for applications like an explosion when a robotic enemy dies, or something like in FFX where pyreflies are released from a fiend upon death. Or maybe playing an animation to represent an enemy teleporting away. Is there a way to do this?

I'm sure this exists, it's just hard to find anything when google search results always turn up MV lol
It's the same in both engines - make a troop event that has a condition of the enemy has <=0 HP, then Play Animation on them.

To make sure you see it if it's the last enemy in the battle, you'd use a turn 0 troop event to put an Immortal state on them first, then during the above event remove Immortal after playing the animation.
Oh... that's super simple. Thought I'd have to do something with a plugin / note tags.

Thank you!

Original thread: https://forums.rpgmakerweb.com/threads/play-animation-on-death.161826/