Changing stat functions?

So I know how to change the names of stats, HOWEVER, I wanted to change the functions for the following,

M.Def and Luck, I wanted to be able to change Luck's function to be like odds of dealing secondary effects and change M.Def to critical damage scaling. (would be renamed to Dexterity)

anyone know how I can do this? I can't find any plugins so I figured it's possible through the engine.
http://yanfly.moe/2015/11/07/yep-25-damage-core/
is needed just so u can use
http://yanfly.moe/2015/11/08/yep-26-critical-control/
which will allow u to change how u do critical hits (dmg multiplier n whatnot)
you'd wanna do something with the "flat critical formula" plugin parameter
http://yanfly.moe/2015/11/07/yep-25-damage-core/
is needed just so u can use
http://yanfly.moe/2015/11/08/yep-26-critical-control/
which will allow u to change how u do critical hits (dmg multiplier n whatnot)
you'd wanna do something with the "flat critical formula" plugin parameter

So it also let's me change all stat functions to whatever I want?
i have no clue how to do the change u want to do with luck.
those plugins will just let u change how damage formulas are calculated

edit:
http://yanfly.moe/2015/10/17/yep-13-auto-passive-states/
u could in a way make a group of "passive state" with <Passive Condition: LUK Above x>
so like "luk > 50" adds state "poison rate 95%"
"luk > 100" adds a second state "poison rate 95%" = 10% resist total
and make a crap ton of those for each state

Original thread: https://forums.rpgmakerweb.com/threads/changing-stat-functions.95252/