Abilities that get more effective vs low health enemies?

Is there a way (or a script that allows for it) to make an attack that become more effective vs enemies with low HP?
I have three types in mind:

1. An ability that does more damage.
2. An Execute that can instantly kills an enemy that's below a certain percentage threshold.
3. An abilitiy that has a higher chance to inflict status effects.

I've moved this thread to ACE Support. Thank you.



All of these can be done via the damage formula most likely. Use b.hp to call the enemies HP and b.mhp to call their max HP. Fro there you'll have to work out the math so that it does what you want, as no one knows your stats in your game but you.
Following up on the above post, this blog post has a bunch of formula tricks that aren't documented well. Helped me a ton!
Code:
b.hp / b.mhp

This will give you a coefficient that goes from 0 to 1 depending on the enemy's health (0 being when it's KO and 1 being when it's at max hp).
I agree with what @bgillisp said. Just to make things easier for you I am going to provide a rough skeleton for those formulae. Keep in mind that I will be using D as "Damage Formula". This represents a whole formula, to be more accurate, it represents the whole skill formula. If I were to use it to refer to the basic auto-attack formula it would represent the whole (a.atk*4 - b.def*2). Remember to change it later on. X is the value of the multiplier you want to use, change that one as well, as it has been said, nobody knows those values in your game but you.
Spoiler: An ability that does more damage
Code:
Math.floor(D * (1 + X * (1 - b.hp/b.mhp)))
This can be done in a different way, for example setting up a minimum health percentage to trigger the skill. The overall skeleton is the same, but you have to change the part after X in it.
Code:
X * (threshold - Math.min(threshold, b.hp/b.mhp))
This is just an example, if you set a proper threshold and then change X accordingly you have what you are looking for.
Spoiler: An execute skill that can instantly kill an enemy that is below a certain percentage threshold
Code:
(b.hp/b.mhp < X) ? (b.addState(1); b.mhp * 8) : D
Spoiler: An ability that has a higher chance of inflicting a status effect
Code:
var r = (b.hp/b.mhp < X ? A + B : A); b.addState(ID) if (Math.random() < r); D
In this formula A represents the normal chance to apply the status effect while B represents the extra chance. ID is your state id.

EDIT: Since this is for MV I changed the formulae into MV ones.
Code:
b.hp / b.mhp

This will give you a coefficient that goes from 0 to 1 depending on the enemy's health (0 being when it's KO and 1 being when it's at max hp).

or just simply b.hp_rate
Code:
b.hp / b.mhp

This will give you a coefficient that goes from 0 to 1 depending on the enemy's health (0 being when it's KO and 1 being when it's at max hp).
This will actually give you either 1 (when b.hp is equal to b.mhp) or 0 (whenever b.hp is less than b.mhp). You have to use either b.hp_rate or call a to_f method on either b.hp or b.mhp.
@Engr. Adiktuzmiko Oh lol, I never knew that existed xD.

@Heirukichi Oh, I forgot this is for VX Ace. You're right. In MV though, javascript will consider it a float by default.
Moved to: ACE Support

All of these can be done via the damage formula most likely. Use b.hp to call the enemies HP and b.mhp to call their max HP. Fro there you'll have to work out the math so that it does what you want, as no one knows your stats in your game but you.

This is an MV post, not Ace. I should have specified that.

Edit:
To be fair, I didn't think I'd need to given that I posted it under MV.

Moving to MV Support.


Your 'Primarily Uses' says Ace, so you can understand where the confusion came from.
Moderator note: Moving to MV Support.
Your 'Primarily Uses' says Ace, so you can understand where the confusion came from.

Oh, crap. Sorry, I forgot to change that.
And you also posted under game mechanics design originally and how do I questions are not a discussion of a mechanic
And you also posted under game mechanics design originally and how do I questions are not a discussion of a mechanic

Okay, good to know for future reference.
I changed the formulae skeletons I posted in my previous post into MV ones. I might have still missed something when editing them, but if I did not they should work.

Original thread: https://forums.rpgmakerweb.com/threads/abilities-that-get-more-effective-vs-low-health-enemies.108824/