Insta-Kill when the target is at a % HP or Below Skill

I can't seem to find a good way to implement this from within the database, so I think I may need a script for it.


I have a Skill in my game that is set to Instantly Kill the target, but only if it is at 15% of its Maximum HP or below. If not, the skill fails to do anything.


I was wondering if anyone could show me an easy script that does this, or a way to do this without scripts?
Nevermind. I figured it out with the help of a friend.


If anyone still wants to know, one method would be to type in


if b.hp_rate <= 0.15; b.add_state(1); end
 


into a Damage Formula. You can change the 0.15 to any number depending on what Max HP level you want the enemy to be at for the skill to work.


However, this skill WILL bypass 0% State Rates, but not state resists. (Credit to Wavelength for helping me figure this out.)


This thread can be locked now.
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/insta-kill-when-the-target-is-at-a-hp-or-below-skill.64977/