Funnily enough, I’ve been moving all the battle calculations today. I found this to be very helpful in what I’ve been doing.
At the bottom, it tells you the offsets of where all the different things are calculated, and at the top it gives a pretty detailed explaination of what each thing does. Based on what I know, I could probably do all but the RES for healing (Given I don’t think it branches from the same place).