What is a formula where the value grows until a certain number and then stops?

I need a formula where the value continues to grow until it reaches a certain number and then stops growing completely.

Something like:
Stop at 25
5 + 5 = 10
10 + 5 = 15
15 + 5 = 20
20 + 5 = 25
Formula stops computing
Are you using a variable?

$gameVariables.setValue(x, Math.min($gameVariables.value(x) + 5, 25))
Thank you so much

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/what-is-a-formula-where-the-value-grows-until-a-certain-number-and-then-stops.118558/