Variable cap for stats?

Is it possible to have a cap or something like it? For example, if the player hatches a pet dragon and gives it fruit/meat, depending on the food would give it stats for stamina or flying, etc. But in the end, that can mean the player giving it stats past 99,999. What if I want the stamina stat to stop at 3,000? Or the attack at 500?

I have an option to view stats of whatever creature I decide on, so the player can see the stats from feeding. But is there a the variable stop at a certain number or something like that?

Thanks to all who read. Have a nice day.
create a variable x and variable y
if: variable x >= variable y
variable x = variable y
else
variable x += number
end

variable x = you can add any number of stats,
variable y set the max value.

you can do that with each stats necessary as long its has its own
variable (or an array to hold those).

Original thread: https://forums.rpgmakerweb.com/threads/variable-cap-for-stats.155269/