Damage formula help, please

I have a skill where an actor can heal an ally's HP at the cost of damaging his own HP a little.  The formula is like this:

a.hp-=(a.hp/20); 250 + a.mat

That formula works as I intend.  However, I also have a skill where I want the character to remove a state, but at the cost of damaging the ally in the same sort of way.  So I reused part of the formula like this.

b.hp-=(b.hp/20)

with the removal of the various states in the effects box, variance set to zero, and no critical.

However, this formula takes all the ally's HP, so killing them.

Clearly I have misunderstood something pretty badly.  Could anyone tell me where I'm going wrong?

Thanks.
add a

;0

at the end of the formula
Thanks. I'll try it out as soon as I'm back at my computer.

EDIT

That works perfectly.  Okay, so I know that it works, but not why it works.  Could you explain to me what that ;0 does so that I can understand what I'm doing and use that info in other situations?

Thanks.
The damage formula expects a damage number as a result, and the last number calculated will always become this damage to the target, no matter what you write into the formula itself.
I see.

Thanks very much for the explanation.
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/damage-formula-help-please.27522/