Make a passive state that increases heals

I want a passive state that amplifies healing for %1 for every %4 health its target is missing. Can some of you sent a lunatic state notetag for it?

I want all healing spells of that certain character be affected.

If you do not have such a notetag, just a skill notetag that I can copy paste should suffice.
Edit: forgot the 4% of missing health part, JamesRyan's tag will work.
If you use Yanfly's Buffs & States and Passive States plugins, i think i can provide you the lunatic state when you heal a target. For <Custum Passive Condition>, you can set it by yourself to fit your purpose:

Spoiler
<Custom Confirm Effect>
//check if it is healing effect. Value > 0 = HP Damage and < 0 = Healing
if (this.isHpRecover() && value <0){
//Get the amount of missing HP
var missingHp = target.mhp - target.hp;
//Get the ratio of missing HP. I will fix it to the first decimal
var missingRate = (missingHp / target.mhp).toFixed(1);
//Define the threshold, for your idea it is 0.04 (every 4%)
var threshold = 0.04;
//Get the times that healing effect gets amplified.
var amptimes = (missingRate / threshold).toFixed(0);
//Define the bonus HP recovered. +1% of based healing amount from skill for each 4% of max HP missing.
var bonus = Math.floor(-value * 0.01 * amptimes);
//Increase the amount of healing effect by the amount of bonus above
value -= bonus;}
</Custom Confirm Effect>

I hope this is useful for you ☺️
@JamesRyan Oh my god thank you. ^^ This will help me so much.

I was talking about max hp missing, for example if I have 50 health but my maximum health is 100 the healing is %12.5 stronger, so what must I change to apply that?
So you mean the amplified healing effect is based on your based healing effect from damage formula, right?

Just change this:
var bonus = Math.ceil(missingHp * 0.01 * amptimes);
to
var bonus = Math.floor(-value * 0.01 * amptimes);

value
is equal to your based healing amount defined by your skill damage formula. So 1% of it should be 0.01 and is multiplied to amptimes (amptimes = 12.5 in your example). So if your target has 50/100 HP and your skill heals 100 HP, the bonus HP recovered is 100 + (100 * 0.01 * 12.5) = 100 + 12.5 = 112.5 (113 due to Math.ceil), right?

This idea of yours is very interesting. May i take it to my project?

EDIT: Sorry i forgot. It should be -value and Math.floor
Of course you can. I am happy to help, and willing to share ideas.

The only problem is the heal now decreases the more HP is missing. 😀
Just another edit for better heal. It should be var bonus = Math.floor(-value * 0.01 * amptimes); ☺️
Ow thank you. It is so useful now, you are my hero. ^^
Is this ready to be closed as solved?
Not yet, it is solved but I also need its damage counterpart please.

I checked Yanfly's tips and tricks and found this.

<Custom Confirm Effect>
// Check if the damage dealt deals physical HP damage.
if (this.isPhysical() && this.isHpEffect() && value > 0) {
// Base the bonus damage off of the user's HP rate.
value *= 2.00 - user.hpRate();
// Add bonus damage equal to the user's missing HP.
value += (user.mhp - user.hp) * 0.50;
// Round up the calculations.
value = Math.ceil(value);
}
</Custom Confirm Effect>

My only problem is making it %1 for every %4 the attacker (and not the target) is missing.

I changed those numbers with weird things but I do not know what value* and value+ is (and the difference between) and how should I modify them.
Here. Damage is amplified by 1% for every 4% of user's missing HP. I haven't tested it yet, but it is based on the healing above:
Spoiler
<Custom Confirm Effect>
//Check if the attack is Physical Hit. Only deal bonus damage via Physical Hit skills. If you want your character to deal bonus damage from every attack type (Physical, Magical, Certain), just remove this.isPhysical() &&
if (this.isPhysical() && value > 0){
//Get the amount of missing HP
var missingHp = user.mhp - user.hp;
//Get the ratio of missing HP. I will fix it to the first decimal
var missingRate = (missingHp / user.mhp).toFixed(1);
//Define the threshold, for your idea it is 0.04 (every 4%)
var threshold = 0.04;
//Get the times that damage gets amplified
var amptimes = (missingRate / threshold).toFixed(0);
//Define the bonus damage. +1% of damage dealt from physical hit for each 4% of max HP missing.
var bonus = Math.ceil(value * 0.01 * amptimes);
//Increase the amount of healing effect by the amount of bonus above
value += bonus;
}
</Custom Confirm Effect>

Your problem about getting enemies' missing HP is from here:
- var missingHp = user.mhp - user.hp; (Should be user, not target)
- var missingRate = (missingHp / user.mhp).toFixed(1); (Should be user, not target)
User
here is referred to the damage dealer, while Target is referred to the damage taken one.
You are the best. ^^

Original thread: https://forums.rpgmakerweb.com/threads/make-a-passive-state-that-increases-heals.78386/