Making a skill that only works when enemy's HP is below a certain level

As the title says...

Is it possible to have a skill that only works when the enemy's HP is below a certain percentage? I tried looking into formulas and such, but I'm smart enough to figure it out.

My main character is supposed to weaken her foe with, then attempt to "instakill" when said foe is weakened.

Thank you for any help.
Put this into the damage formula:
b.hpRate() < X ? b.mhp : 0

Replace X with the percentage you want.
Example:
0.1 means 10%

So if the enemy has less than 10% health, it deals lethal damage, otherwise it deals 0 damage.
Thank you so much!!

Original thread: https://forums.rpgmakerweb.com/threads/making-a-skill-that-only-works-when-enemys-hp-is-below-a-certain-level.138765/