It's pretty simple, first thing you'll need to know is that max for tick_def is 10000 (100%). Out of this and luk that you want immunity on you solve simple equation:
x = 10000 / ChosenLuk;
After that just change this line:
tick_def = st->luk*40;to
tick_def = st->luk*x;Where x is the result of equation.
Example: You want immunity on 300 luk, that means
x = 10000 / 300;
x = 34;
(It's for you to decide where to round, up or down. I rounded up. That measn that actual luk you'll need for immunity is 295. If you round it down, then needed luk will be 303)
So the resulting line will be:
tick_def = st->luk*34;
Thank you. = ]