Help with Permanent stat items

So at some point I decided that getting stat bonus items would be needed - getting HP and other stats to work was simple enough but once I got to dealing with MP I started pulling hairs.

Most people would stop at simply boosting the max value, but I want to make sure that the player also changes their current MP by the same amount boosted. The weird thing is that the script I tried does not work the same way it did for HP, and I spent quite a bit of time looking at references. For those wondering, I'm trying to do the same thing the Dragon Quest series did with stat boosting items.

The best way to describe the issue is that I can get the script to put in text how much it boosts Max MP by and actually doing it but it does NOT change the current MP by that same amount. Either I'm using the wrong syntax or $gameParty._targetActorId doesn't get taken correctly when it comes to battler.gainMP.

Script in question for reference:

var randomStat2 = Math.randomInt(5)+1; var user = $gameActors.actor($gameParty._targetActorId); $gameVariables.setValue(12, randomStat2); user.addParam(1, randomStat2); user.gainMP(randomStat2);

The last line is the problem, so if someone has advice I'd appreciate it - just let me know if anything else is needed.
Could you not also make the item recover MP by the amount boosted?
user.gainMp(randomStat2);

The 'p' should be lowercase.
Also note that for basic params (including Max HP/MP) you can do this with a "Grow" Effect on the Skill/Item, so scripting might not be necessary here.
user.gainMp(randomStat2);

The 'p' should be lowercase.
Yup, that was it. If it weren't late at night earlier I probably would have caught that, especially if I looked at the HP boosting item.

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/help-with-permanent-stat-items.147006/