MV Level Cap based on character stats?

I want to apply a system similar to level control of Digimon World DS, where the digimon Aptitude stats affect their level cap. In my case, i planned to change and use Luck stats in similar way of Aptitude.

In technical, the way they handle exp is that the character will stop receiving exp once their level is in equal with their Aptitude stats, even when the exp received could level them more than their level cap.

Is there a way or a plugin that could control level cap or maximum level of each character based on one of their stats?
I've had code in an old thread for a long time that you could use, but I just refined it into a plugin to make it simpler for people to use.


You'd set the plugin parameter to:
Code:
cap = user.luk
I've had code in an old thread for a long time that you could use, but I just refined it into a plugin to make it simpler for each other.


You'd set the plugin parameter to:
Code:
cap = user.luk
omg its works as intended, thank you so much.

i will consult in the plugin thread next time

Original thread: https://forums.rpgmakerweb.com/threads/level-cap-based-on-character-stats.179085/