Skills that regen MP

Referred to this thread here, but I encounter the same issue where the skill deals no damage AND does not restore MP. The formula I used is the following:

a.gainMp(Math.floor(a.mmp + 4)); 100 + a.mat * 2 - b.mdf * 2


I want the Actor to restore a certain amount of MP, hence the (a.mmp + 4). What could I be missing here?
The problem is you are using MV syntax.
Try this.
Code:
a.mp += (a.mmp * 0.4).to_i; 100 + a.mat * 2 - b.mdf * 2
Incredible TheoAllen, that works!

Another quick question: If I wanted to restore exactly 4 MP, would I change (a.mmp * 0.4)? I've tried (a.mmp + 4), but it restores the Actor's MP entirely.
a.mmp making it 'max' mp + 4 (although max is max, so the +4 isnt doing anything).
if only want 4 total you would remove the a.mmp and just have the 4
a.mp the extra m is maximum mp
That would take the current mp though.

If you want just a flat +4 mp, you just write "4" instead.

a.mp += (4).to_i; 100 + a.mat * 2 - b.mdf * 2
ya was editing when you quoted
a.mp += 4.to_i; 100 + a.mat * 2 - b.mdf * 2 was what I discovered after fooling around. I appreciate the advice y'all!

Original thread: https://forums.rpgmakerweb.com/threads/skills-that-regen-mp.139672/