I'm really not going to say much about this right now, but figured it was due an update.
This is for physical attacks only, by the way.
First, know that the most important aspect of damage is the Base Damage. It is derived from two stats: Attack and Level. (And note that Attack = Strength + Weapon Attack modifier)
The formula used is:
Base = Att + [(Att + Lvl) / 32] * [(Att * Lvl) / 32]
(note that
- means the integer portion of x)
Once you have the Base damage, most modifiers are placed on top of this. Back Row damage halves it, for instance, while a Critical Hit (or Deathblow) would double it. Also, modifiers due to the actual attack will be used here (example: the Braver Limit Break is 3x Base).
(Note: Mini affects Attack only; it reduces it to 0)
Once that's done, Enemy Defense is handled. First, the Damage Modifier is worked out, then it is applied to the base damage:
Dam Modifier = (512 - Enemy Defense)/512
New Damage = Damage * Dam Modifier
(Note: Piercing Attacks ignore Defense)
Next, if the attack warrants it, random variation kicks in. The variant gives a number between: [Damage * 15/16] ... (Damage - 1)
At this point, damage is sanity-checked: if Damage < 1, then Damage = 1.
Finally, multi-hit bonuses from stuff like the Yoshiyuki, Master Fist and Goblin Punch are added if they're needed. The damage is again sanity-checked: this time, if Damage > 9999, then Damage = 9999.
(Note: Not sure of the order some of these things are done in, especially that last... need to test a few more special cases)
Whatever number you end up with is your final damage.
HTH. HAND.