Trying to make sense of coding

So I am trying to read the code for RPG Maker MZ And want to alter the code for running away to factor in the characters and parties defense stat, not the agility stat.

I tried changing all mention of Agility/Agi to Defense/Def but that didn't work.

Any recommendations on how I can learn?

Edit: I am using the Visustella Battle Core Plugin