Random effects based on the users stats

So, it's easy to make skills that have random effects on the user based on their stats by setting a variable to the users stat, then rolling a variable randomly then checking if the random variable is lower. Different skills would use different stats to make different combinations of equipment viable

I was wondering how this could be done with effects against enemies

I'd like to give the player control over how often different random things happen and need help with this please

Original thread: https://forums.rpgmakerweb.com/threads/random-effects-based-on-the-users-stats.146531/