Store the max level value on the element
Generalize the variables
Use cur instead of min
Only enable on the player frame