[Resolved] Attribute Hard Cap?

Not sure where to put this, so im putting it here for now.

Anyone know of a way to give a hard cap to Special/Extra Attributes?

Like, lets say I only want 100% Evasion and it cant increase anymore then that?

I am using plugins that when increasing Base Stats (Yanfly Stat Base/Special/Extra Attributes Plugins), it increases several other Special/Extra Attributes a bit.

Thank you.
Not sure where to put this, so im putting it here for now.

Anyone know of a way to give a hard cap to Special/Extra Attributes?

Like, lets say I only want 100% Evasion and it cant increase anymore then that?

I am using plugins that when increasing Base Stats (Yanfly Stat Base/Special/Extra Attributes Plugins), it increases several other Special/Extra Attributes a bit.

Thank you.
Wrap whatever code you have for those extra params in a Math.min(1, x). Replace x with your current xparam formula. For example, the base crit formula in the plugin is (base + plus) * rate + flat, so change that to Math.min(1,(base + plus) * rate + flat)
This will ensure that the maximum value a float xparam can have is 1, as it will always use the minimum between 1 or your value, whichever is lower.

Likewise, for sparams, they're not floats, so you can use the same thing with whatever maximum value you want. e.g Math.min(300, (INSERT OLD FORMULA HERE)).
Thank you so much. IT WORKS!

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/resolved-attribute-hard-cap.124713/