How would I go about making an Estus Flask item in my game?

I'm new to RPG Maker game making and I'm still figuring out how it works. I was wondering how I could make a healing item that you have a limited amount of, and is capped at a certain number that can be increaced by finding more of the same item. The item would also get replenished at checkpoints.

How would I go about making such an item?
You could reserve a variable to be your max estus flask count and then at every bonfire or whatever, you remove all the flasks the player had and give them the same number as the variable.
Any time the player does an event that gets them one, add a condition that checks if their flask count is less than the variable and not give them if theyre already at cap. If they do something that increases their max, give them a flask and increment the variable

They'll never have more than they should unless you forget to check the variable in an event

Original thread: https://forums.rpgmakerweb.com/threads/how-would-i-go-about-making-an-estus-flask-item-in-my-game.171690/