Absorb damage State?

Hey guys,

I'm looking to make a State that absorbs damage.

Say Actor 1 has the Absorb State. If he receives physical damage, then maybe 80% of that damage gets converted into HP that heals him and 20% stays damage.

And, he has another different state (Absorb State Full) that converts 100% incoming magical damage to HP.

I feel like there used to be an easy way to do this in VX Ace but I can't for the life of me figure it out in RMMV. x_x

Thanks so much.
Are you using "Yanfly's Buffs & States Core" plugin? If yes, i think i can help you.

For the first one, 80% of physical damage taken, is converted to HP, right? You can put this note tag into your state:
Code:
<Custom React Effect>
if (value > 0 && this.isPhysical()){
var heal = value * 0.8;
target.gainHp(heal);
target.startDamagePopup();
target.startAnimation(x); //Change x into an animation ID if you want to display animation when this effect is activated.
value = value * 0.2;}
</Custom React Effect>

And for the second one, 100% MAGICAL damage taken is converted into HP, right? So here is the note tag:
Code:
<Custom React Effect>
if (value > 0 && this.isMagical()){
target.gainHp(value);
target.startDamagePopup();
target.startAnimation(x); //Change x into an animation ID if you want to display animation when this effect is activated.
value = 0;}
</Custom React Effect>

I haven't tested them yet, but they should work.
Yay! You're a life saver! (I do use this Plugin. ^_^)

Works beautifully, the only issue is that the damage itself is not negated. So it is "90 Damage" + "90 Healed". I can double the heal value, but it'd be more ideal if the damage is gone completely.
Just put in the note tag fields of your states. And don't worry about that "this.isMagical()", it is used to recognize the hit type of skills which your actors get hit.
Just put in the note tag fields of your states. And don't worry about that "this.isMagical()", it is used to recognize the hit type of skills which your actors get hit.
I realized that and edited my post while you were posting, haha. Sorry. 👋 So yeah, I changed it to a new question, please see the original post. Thanks so much!!😍
Code:
<Custom React Effect>
if (value > 0 && this.isMagical()){
target.gainHp(value);
target.startAnimation(x); //Change x into an animation ID if you want to display animation when this effect is activated.
value = 0;
target.startDamagePopup();}
</Custom React Effect>

Maybe this can solve the problem. I have moved "target.startDamagePopup();" to the bottom. Let me know if something else still happens.
Works great now, thank you!

Original thread: https://forums.rpgmakerweb.com/threads/absorb-damage-state.82101/