Absorb Ally HP Skill

I'm looking to make a skill in which an actor absorbs HP from an ally, replenishing his own. I also would like it if the skill could stop short of killing the target (leaving 1 HP). The problem is, I can't seem to get it working. The ally is damaged, but no HP is being absorbed.

I've set the skill up so that it's a HP Drain type with Absorb element. The scope is One Ally, usable Only in Battle.

The formula is as follows.

if b.hp >= a.hp; a.mhp - a.hp else; a.mhp - a.hp + 1; end;
Hopefully someone can set me on the right track with this. Thanks in advance! 😉
Hmmm... maybe because of the weird restrictions of the damages (like an HP damage skill cannot be used on an ally from my experience)... try doing the drain inside the formula too

so like:

Code:
if b.hp >= a.hp; x=a.mhp - a.hp;else; x=a.mhp - a.hp + 1;end;a.hp+=x;x
PS: it's full heal to the caster btw, since ur healing him based on the difference between his max and current hp
Hmmm... maybe because of the weird restrictions of the damages (like an HP damage skill cannot be used on an ally from my experience)... try doing the drain inside the formula too

so like:

if b.hp >= a.hp; x=a.mhp - a.hp;else; x=a.mhp - a.hp + 1;end;a.hp+=x;xPS: it's full heal to the caster btw, since ur healing him based on the difference between his max and current hp
Yeah, I know. It's really an all-or-nothing kind of skill, for situations where you need to keep that one person alive (perhaps only their skills can bring down a boss or something).

Thank you for the help! The skill works now, although it does kill the ally should the HP damage be too great. But I guess I can live with that/try and tinker with it.
Code:
x=a.mhp - a.hp; if b.hp <= x ;x=b.hp-1;end;a.hp+=x;x
this way, if b will die, it will only deal damage equal to his hp minus 1 so that he will still have 1 hp left
Code:
x=a.mhp - a.hp; if b.hp <= x ;x=b.hp-1;end;a.hp+=x;x
this way, if b will die, it will only deal damage equal to his hp minus 1 so that he will still have 1 hp left
I just happen to pass by a topic of what I needed, I am new to doing formulas so im a little lost on what I should input for X on this formula, Im trying to have variance from 100 by doing 100=a.mhp - a.hp; if b.hp <= 1 ;100=b.hp-1;end;a.hp+=100;100 but I guess I just don't fully understand yet, if you can help me out with this, many thanks!

LawrenceindaSky, please refrain from necro-posting in a thread. Necro-posting is posting in a thread that has not had posting activity in over 30 days. You can review our forum rules here. Thank you.


Please make a new topic with your question.

Original thread: https://forums.rpgmakerweb.com/threads/absorb-ally-hp-skill.23931/