When player hits any npc that transforms into another npc by npc.transform hook which is in npc.hiteffect it transforms the last hp it have other than having full hp (In vanilla it checks the new npc type and old and if olds maximum life is not equal to new one it directly transform it with full hp).
When player hits any npc that transforms into another npc by npc.transform hook which is in npc.hiteffect it transforms the last hp it have other than having full hp (In vanilla it checks the new npc type and old and if olds maximum life is not equal to new one it directly transform it with full hp).