how to make enemy transform at death or 0 hp

ive been up all night trying to figure out how to make an enemy transform at 0 hp but have been unsuccessful.
im using all yanfly plugins. i saw his enemy transform tips&tricks video but i couldn't get it to work as my javascript knowledge is amateur. any help would be very much appreciated

i hope i posted this on the right board.
I don't know too much on this, but did you try giving the enemy the immortal state?
absolutely no need for javascript knowledge here.

1) make a new state "immortal" that has no icon, no text and is only immune to the death state
2) make a troop event run at turn 0 to apply that state to the enemy you want to transform on HP=0
3) make a second troop event with the condition "enemy HP=0" to be triggered on death
4) include a change enemy and then heal enemy event command and after that a remove immortal state command (unless you want it to transform multiple times on death)

finished.
the only exeption would be if you have a battlesystem that cannot handle the "change enemy" command - in that case you'll need a summon plugin compatible to that battle system.
I don't know too much on this, but did you try giving the enemy the immortal state?
i did make then immortal but then i couldnt get them to transform.
absolutely no need for javascript knowledge here.

1) make a new state "immortal" that has no icon, no text and is only immune to the death state
2) make a troop event run at turn 0 to apply that state to the enemy you want to transform on HP=0
3) make a second troop event with the condition "enemy HP=0" to be triggered on death
4) include a change enemy and then heal enemy event command and after that a remove immortal state command (unless you want it to transform multiple times on death)

finished.
the only exeption would be if you have a battlesystem that cannot handle the "change enemy" command - in that case you'll need a summon plugin compatible to that battle system.

thank you andar. im so used to using plugins that i forget about the built-in functionality in rpgmakermv.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-make-enemy-transform-at-death-or-0-hp.111168/