OK I just looked through my old notes, and you can start the damage formula here:
// Calling Function to handle attack
$AC9E:20 5F 97 JSR $975F
So this is where you would want to start if you want to trace the damage formula and possibly hex-edit it to do something else. The start for non-special attacks should be at $97CD.
When it gets to $9915, the actual damage inflicted will be at $10 -> $12. So as you can see, the damage formula is over 400 bytes, and over 150 lines just for the regular physical attacks. If you guys want to change it, you can start there.