A few corrections:
1) Maxim's normal attack at this point has a 5% chance (third RNG call < 13) of being a critical hit. Critical hits ignore defense.
2) Dive is actually double ATP, not double damage.
3)
if(rng.callRN()<64>63 && a<128){ // secundary item drop check\
I hope this was just a problem in copy/pasting, because this line won't compile.
4) Defending makes the attack deal 5/8 damage rounded up after everything else is factored in. It does not double DFP.
5) If the catfish used Flash the previous round, it will not do the RNG check for Flash this round.
002B: target random opponent
002D: with probability 193/256, go to 0x0040
0031: element 0x0004 physical attack with 65 power
0037: attack name "Mega quake"
0039: attack animation 80
003B: variable 1 := 0x0000
003F: stop
0040: if variable 1 != 0x0000, go to 0x0051
0046: with probability 225/256, go to 0x0051
004A: cast spell "Flash"
004C: variable 1 := 0x0001
0050: stop
0051: elements 0x0004
0054: attack
0055: variable 1 := 0x0000
0059: stop
Other than those, everything looks accurate apart from a few places where the game rounds intermediate values.