A way, would be to store the amount of times that a user has used said feature, I see you're selecting something to do with their chance, but aren't updating the table after they've 'used' the function.
Getting a percentage is the easy part (actually you don't need to do any calculations for it, providing you know the percentage, 35% of 100 is, well, 35.)
As for using percentage in determining the results, I'm a little shady on.
Perhaps this would work, essentially generate a number between 1 and 100 in your case. , then check to see if the random number is between 1 and the percent chance (inclusive).
This way you have a 40 in 100 chance of passing, and a, well, 60 in 100 of failing. I think, I could be wrong or someone could provide a more elegant solution, but doesn't hurt to give this a try.
$perc = 40;
$rand = rand(1, 100);
if ($rand >= 1 && $rand <= $perc) { //Probably could just do if ($rand <= $perc) {
//pass
} else {
//Fail
}
Note: Incredibly tired, so I take no responsibility in breaking something/or being wrong and wasting your time trying it out. (: