Tweaking the LUK stat in the default calculation

I want to make the LUK stat more relevant. At the moment I find it somewhat trivial in its effect.

What I would like is to change the way the default script calculates things so that each 1 point of Luck over the opponent equals a + 0.5% chance to ailment success rates.

However, my knowledge grade is such that I'm not even sure which default script does this, let alone how to change it. I had thought it was Game_Battler, but I don't see a specific % rate.

Could anyone tell me what to do?
Thanks
@Kes : I was about 5 seconds behind you, as I posted about this on the progress thread. The code you would need is this (edited for what you want).

class Game_Battler < Game_BattlerBase

def luk_effect_rate(user)
[(user.luk - luk)* 0.005 + 1, 0.05].max
end

end

That should result in a 0.5% increase in the chance to add a state, multiplied to the default rate (so 1 point more in LUK would change the chance by 100.5%. Not a lot though).

We would need to edit more if you want it added though instead of multiplied, as that part of the code is elsewhere.

Edit: Are you trying to make it so that if you have 200 more points of LUK than the enemy, your chance of the status aliment sticking is doubled?
@bgillisp Well, technically it's not mathematically correct to say "change the chance by 100.5%". That would be a huge change.

Ah. It does look like it's meant to be multiplicative rather than additive. Though when I was testing it on MV, which uses pretty much the same formula, it did seem to conform pretty closely to what I expected from the additive values, though more play testing would be needed for me to confirm that.
@bgillisp Hmm, the chance of anyone being 200 points higher than an opponent is vanishingly small. I think I may have miscalculated what the rate change I need would be.

I think it would be more like: if 100 LUK points higher (difficult, but not absolutely impossible) then the chance of the affliction sticking is double.
I've confirmed that it is multiplicative in MV, and I'm guessing the formula is the same in Ace.

var chance = target.debuffRate(effect.dataId) * this.lukEffectRate(target);

Game_Action.prototype.lukEffectRate = function(target) {
return Math.max(1.0 + (this.subject().luk - target.luk) * 0.005, 0.0);
};

So to give an example of how this works numerically, as is: If my luck is 60 and the target's is 100, there is difference of 40 luck, so that lukEffectRate is 0.8. Therefore, if an ailment had default rate of 60%, it now has a rate of 48% - a drop of 12 points instead of 20. Swapping it, so that you have 100 luck and they have 60 luck, gives a 72% rate.

Now, if the multiplier was 0.01 instead, then lukEffectRate is 0.6, so the ailment has a 36% chance of success. Conversely, if the user has 100 luck and the target has 60 luck, the success rate is now 84%.

Now, if you want to make things additive, then you'd probably want to rewrite the formula as:

var chance = target.debuffRate(effect.dataId) + this.lukEffectRate(target);

Though come to think of it, I might prefer a multiplicative formula to keep low-rate effects from getting out of control.
Ok, then change the code to:

class Game_Battler < Game_BattlerBase

def luk_effect_rate(user)
[(user.luk - luk)* 0.01 + 1, 0.05].max
end

end

In bold is the change from the other code. If that still proves too low, change 0.01 to whatever your % is (in decimal form though).

That will make it so that each point of luck is about a 1% increase. Again, since it is multiplicative, it won't be quite the same as a +1% increase, but I've noticed that in testing it works out about as well.
Thank you both very much.

@bgillisp I think that looks like it should do the job.
I'm going to leave this thread open in case I hit a problem, but my instinct is that this is now solved.
Your help is much appreciated.
@bgillisp Agreed, it won't be the same. Instead of 60% to 70% for a 10 luck difference in the 0.01 multiplier case in your favor, it will be 60% to 66%. Whereas if the ailment had a base 10% success rate, it will now be 11% rather than 20%, the latter of which is a highly significant change to the balance of the skill.

But I think this (the multiplicative formula with a 0.01 multiplier) will work for my purposes. With the right skills, it's possible to open a luck gap of possibly 50 or more in your favor in my game, which means x1.5 or more to the rate of ailment infliction. Going from 60% to 90% seems about right for that sort of difference.
@Arithmetician : Right. If you make it additive, it opens up big issues like what you mentioned with the 10% status chance being higher. Plus, if you were even 10 points lower, then the aliment would never hit. That's probably why it is multiplicative.

Original thread: https://forums.rpgmakerweb.com/threads/tweaking-the-luk-stat-in-the-default-calculation.76126/