How do I make an item that increases the level of the user that consumes the item?

I've been experimenting with RPG Maker MV for a small bit, and one thing i need help with is making an item that increases the level of the user that used the item by one. I saw that you can do this by setting a common event that increases the level of one particular party member or the whole party, but I need the item to level up the party member that consumes the item, and they get the level up.

I also noticed you could assign the level up to a variable, and i was wondering if i could assign a variable to the level of the party member, and make it so it will give the level to the party member that uses it.

Does anything like this sound possible?
You could do that with different ways, the easiest is probably with a plugin.

You can use http://himeworks.com/2016/02/formula-effects-mv/
Then add the following notetag to the item.

PHP:
<formula effect>
a.changeLevel(a.level + 1, false);
a.recoverAll();
</formula effect>

This changes the user's level by 1 and recovers all his HP and MP. If you don't want that reemove the recover part.
You could do that with different ways, the easiest is probably with a plugin.

You can use http://himeworks.com/2016/02/formula-effects-mv/
Then add the following notetag to the item.

PHP:
<formula effect>
a.changeLevel(a.level + 1, false);
a.recoverAll();
</formula effect>

This changes the user's level by 1 and recovers all his HP and MP. If you don't want that reemove the recover part.
Alright, i guess theres no way around it, other then to use plugins. Thanks anyway, it does work the way it should, at least.
Alright, i guess theres no way around it, other then to use plugins. Thanks anyway, it does work the way it should, at least.
actually, now i have another problem. i just tried it out with other party members, and it automatically defaulted to the first party member, which is just like making a common event where it only gives it to one character the level up, regardless on who uses the item. how do i fix that?
In the note tag change the a to b.
a refers to the user
b refers to the target
You could also just do that formula in the damage formula of the item so that you won't even need a plugin, just turn it into one line like this

b.changeLevel(b.level + 1, false); b.recoverAll();0

PS: using a. defaulted to the party leader since a = user and if you're on the menu, the user is always the party leader since the game doesn't allow you to choose who uses the item, only the target is choosable.
You could also just do that formula in the damage formula of the item so that you won't even need a plugin, just turn it into one line like this

b.changeLevel(b.level + 1, false); b.recoverAll();0

PS: using a. defaulted to the party leader since a = user and if you're on the menu, the user is always the party leader since the game doesn't allow you to choose who uses the item, only the target is choosable.
Okay, i tried using the formula, but it didnt seem to work as a regular item. i also dont have a good grasp on formulas just yet, and i would like to know what i did wrong with copying the formula into the damage formula section of the item.
I think the game limits the damage (like you can't use HP recover on an actor that has full HP). So maybe you won't be able to use it for this. Sorry

Anyway I just suggested it so that you know that you can utilize the damage formula to do effects too (basically any valid JS code can be run by the damage formula), but if you're gonna use long effect formulas in the long run (long meaning they won't fit the damage formula bar), then having that plugin and using it would be better for you 🙂
I think the game limits the damage (like you can't use HP recover on an actor that has full HP). So maybe you won't be able to use it for this. Sorry

Anyway I just suggested it so that you know that you can utilize the damage formula to do effects too (basically any valid JS code can be run by the damage formula), but if you're gonna use long effect formulas in the long run (long meaning they won't fit the damage formula bar), then having that plugin and using it would be better for you 🙂
Okay, i figured out the issue, which as you said, has to do with the fact that an item cant be used when at full health. All i did was make the level up item to do a very insignificant amount of damage to the user, and then they would get the level up. I may actually experiment to see if i can actually make it deal damage, and then automatically heal the damage done, to see if i could remedy that. Thank you, everyone, for your help and attention.

Original thread: https://forums.rpgmakerweb.com/threads/how-do-i-make-an-item-that-increases-the-level-of-the-user-that-consumes-the-item.80431/