Need help for an in-game "item refund"

Hello makers !

One of my pillars on wich my game is buildt is that the heroes don't gain stat by leveling up, only spells and specialization. Therefore, the player can upgrade his character with some "permanent upgrade to stat item" (I called them Tomes, but in games like Dragon Quest they're Seeds, like this : http://dragonquest.wikia.com/wiki/Seed_of_strength)

The problem is, the more the player advance the more mates he'll have, I don't want him to spend all of his seed/tomes randomly too soon and be sad after.

So I'd need to create a place in my game, where the player can have his used Tomes back, and reset his stat boost.
I was thinking about incrementing a variable each time he use a book (depending of the book type), and then when he want to reset, set his stat directly to base ones (not lowering it, cause i'd demand to check on who the book have been used) and refilling all of the books.
Do you think it could work or do you see any easier method (with or without plugins) ?
If you know what the base stats are, you could probably calculate how many Tomes for each Stat had been used to get to number an actor is currently at. You could do some math to figure this out and then grant the player the correct number of Tomes back to them.

A simpler solution would be to use SumRndmDde's Stat Distribution plugin. While a little less flavorful than the Tomes in your system, it essentially functions the same way, would be easier to manage, would allow you to separate points for each actor as opposed to risking having one character get all the Tomes while the rest stay base stats the whole game and has functionality built into it for resetting stats like you are asking for here. It's worth a look, at least.
Well I think I'm gonna go with the math idea 🙂

The plugin is a good idea, but there is two problem with this. First, it's character bound, so a player that do choose to only boost one character won't be able to. Second, Stat boost point works for every stat, not only for one. But it was a good idea, just not quite my system 🙂

Thx for your answer tho 😀

EDIT : So is there a notetag or something to make the item changing a var on use ? The only option I see is binding a Common event on every of those books, which makes a lot of CE as I also have Picture Common Event fro Yanfly, I don't really want to overcharge my game :/
You can likely achieve this with just one Common Event. Set a variable that the CE will use to determine which Stat is being boosted and then call the CE. It can handle tracking the change in an appropriate variable and then apply the bonus. You'd probably need to find a way to get the Actor ID that the item is being used on as well. That'll might end up being the hardest part.
Getting the Actor ID isn't necessary, cause I want the reset to be for the full party. Like if he used an HP tomes on actor 1 and Attack tomes on actor 2, if he goes to the reset NPC, he gets all of the books back, and all the actor stats are reseted.

You're first point seems cool, but I didn't quite get it (I'm french so when english gets too complicated I'm having an hard time)
I see how one CE could decide what stat is boosted with a switch, but how do I make an item use modifying a var ?
Like if I use HP Tome, what do I need to do before I call the CE so he gets that I used an HP tome and he increase the HP Tome var ?
Sorry, I'm not sitting in front of my computer so I'm just throwing out ideas a lot of the time. Now that you mention it, there my not be an easy way to set a variable within the item properties before calling a common event. You might have to create a separate common event for each Tome.
Well at least I can make my system work 🙂

But I wonder, a common event running only when called won't slow down the game right ? The only CE you need to use carefuly are the automatic/parallax ?

Original thread: https://forums.rpgmakerweb.com/threads/need-help-for-an-in-game-item-refund.90750/