MV A skill that only works if the target is below 50% hp

I want a boss that uses a skill that instantly kills a target (does damage equal to target's remaining HP) but ONLY if the target has 50% hp or less. Is this possible? I'm not worried about how to decide when the enemy uses the skill, just getting the skill to work like that.

If this needs a plugin, I'm sure one exists already yeah?
Is this possible?
it can be done with just the formula.
Code:
b.hpRate() < .5 ? b.hp : 0
You are the best, thank you a ton!

Original thread: https://forums.rpgmakerweb.com/threads/a-skill-that-only-works-if-the-target-is-below-50-hp.181099/