Formula box skill woes

Im trying to figure out how to make a mp draining skill heal hp instead by using just the formula box. I'm probably over thinking it and after a week i can't get it working.
Am i overlooking something?

I've moved this thread to VX Ace Support. Thank you.

@bgillisp oops! ≥﹏≤
I'm on mobile and it's hard to tell at times.
a is the skill user, b is the skill target.
and then just use mp and hp as the attributes.

Example:
Code:
r=4*a.atk-2*b.def; a.hp+=r; r
(this is untested and would have some quirks if the target has less than r MP and so on, but you can take it from there)
@Andar After some tweaking it works how i want. ♡(∩o∩)♡ Thanks!

Original thread: https://forums.rpgmakerweb.com/threads/formula-box-skill-woes.110514/