Creating a "finishing blow" skill

I'm trying to go about creating a skill that would restore the user's hp if it kills an enemy, in a similar vein to Fell Stinger from Pokemon. Would there be any way to create this skill using damage formulas?
There is a way of doing this using damage formula but I think there are better ways. To do it using damage formulae you have to:
  • check if target has any immortal state;
  • check if target has any kind of resistance to that damage;
  • calculate virtual damage dealt (taking into account damage reduction);
  • calculate virtual remaining hp (b.hp - b.virtual_dmg);
  • if your virtual damage reduces enemy's hp to 0 then you can heal the user.
That said it requires few checks and in VXAce you can't use many characters in your formula box. Using a script is much better in this case. Doing this just using formulae also requires you to set variance to 0% since your skill damage has to be 100% predictable or your character might recive healing effects even when the target is still alive.

Another way of doing this (if you don't want/know how script it) is to use troop events.
  • Store both user and target in a variable then turn on a switch;
  • At the end of each turn check if the switch is on then turn it off (don't forget to turn it off!!!!);
  • If the switch is on force your character (the one stored previously) to cast another skill on the target (the one stored in your other variable);
  • After the skill is executed check if the number of alive enemies is the same as before;
  • If the number of enemies decreased heal your character.
You could also heal your character at the beginning of the next turn, how you handle the healing part is up to you. If you wanna use the healing at the beginning of the next turn then just turn the switch off after healing.

These two methods are just few ways of handling this without using scripts. Keep in mind that - of course this is my opinion - using a script is the best way.
Yeah, I was thinking that using some kind of script would be much easier in achieving this effect, but I can't seem to find any that'll help me create this skill. Thanks for the help, though.
If you can't find anything then you can try one of the methods above. They are not the best solution to your problem since they have pros and cons but they still work.

Original thread: https://forums.rpgmakerweb.com/threads/creating-a-finishing-blow-skill.86293/