In combat, each participating unit has a delay value associated with them which determines when they may act again. Since the term delay has multiple meanings we will use the term action time (AT) for this time-until-next-action value. After each action the game find the unit with the lowest AT of all battle participants. All units AT values get reduced by that units (say Pom A) AT value. Pom A is now at 0 AT and may act. The incurred AT for that action gets added to Pom A's AT value and the cycle repeats until the battle is over. If two units have the same AT value the unit that completed its last action after the other will move first.
Each action has a base delay/time associated with it. We will use the term skill time (ST) for this base delay. For instance, moving costs 20 ST. Tables with skill times for SC and 3rd can be found here and here. The AT value is calculated by
AT = RoundDown((ST * 100) / SPD) .
For example, if Pom A with 30 SPD moves it incurs an AT cost of RoundDown(20 * 100 / 30) = 66. Note that AT value is always rounded down. It is theoretically possible to reduce it to 0. (In practice, only casting times are short enough for this to happen.)
In addition to their skill time arts have a cast time (CT) associated with them. The incurred AT cost for casting an art is
AT = RoundDown((RoundUp(CT * CastModifier) * 100) / SPD) .
The CastModifier depends on the Cast quartz used. It is 1, 0.7, 0.3 and 0.05 for no cast quartz, Cast 1, Cast 2 and Time Gem respectively. For example, the (real) cast time when casting Teara (CT = 4) with Cast 2 quartz equipped is RoundUp(4 * 0.3) = 2. With 30 SPD, this requires RoundDown(2 * 100 / 30) = 6 AT until Teara takes effect.
Utility of the combat damage formula (such as there is) is largely confined to evaluating equipment and quartz against alternative choices. Paragraph 2.1. covers this topic. For readers interested in the theory, paragraph 2.2. gives a simplified account of the average damage dealt in combat followed by examples in paragraph 2.3. The complete combat damage formula is relegated to Appendix A (Warning: mathy and pedantic).
Impact of quartz and equipment
For a quick estimate whether a new quartz or piece of equipment is worth using if is useful to know that one additional point of STR will increase inflicted damage by 3.4 on average and one additional point of ATS will increase damage by 4.08 on average. Conversely, one point of DEF or ADF will decrease damage by 2.833 on average. These values are independent of the attack/art used and of any active buffs. (However, stats aquired via levelling get increased by buffs so their impact is a bit higher.)
In situations without active buffs damage inflicted by player characters averages to
Damage = 3.4 * (STR + AbilityBonus) - 2.833 * DEF
for physical attacks and
Damage = 3.4 * (1.2 * ATS + AbilityBonus) - 2.833 * ADF
for arts (assuming 100% elemental efficiency). Each craft and art possesses an AbilityBonus value. For instance, Olivier's Sniper Shot 2 in SC has an AbilityBonus of 60. When he uses it damage is calculated with an additional 60 STR added to his stats. This is equivalent to 204 more damage over a normal attack. Tables with AbilityBonus values for SC and 3rd can be found here and here.
The situation is slightly more complicated when active buffs are present. Buffs in Trails in the Sky only affect the character stats, not stats added by equipment or quartz. Consequently, the damage formulas become
Damage = 3.4 * (STR + STR_Char * BuffValue + AbilityBonus) - 2.833 * DEF
Damage = 3.4 * (1.2 * (ATS + ATS_Char * BuffValue)) + AbilityBonus) - 2.833 * ADF
respectively, where STR_Char is the base strength of the attacking character without equipment or quartz and BuffValue is the relative effect of active buffs divided by 100 (eg. 0.2 if the attacker is affected by Estelle's Morale).
Assume Estelle (SC) has 600 base STR, and is equipped with a weapon with 400 STR and a Ruby Gem. In total, she has 1150 STR. When attacking a Pom with 1000 defense using True Hard Break (AbilityBonus = 100), she deals (1150 + 100) * 3.4 - 1000 * 2.833 ~ 1417 damage on average. If Estelle buffs with Forte before attacking with True Hard Break we get (1150 + 100 + 600 * 0.2) * 3.4 - 1000 * 2.833 ~ 1825. In practice it is more useful to merely calculate the added effect of buffing beforehand which is 600 * 0.2 * 3.4 = 408 damage. In the same way, the added damage of an +STR accessory or new weapon can be estimated.
ToHit = DEX / (AGL + DEX)
where DEX is the attackers dexterity and AGL is the defenders agility. Most SC and 3rd bosses have extremely high dexterity.
(Note: As far as we can tell, in SC the art Sylphen Guard has the undocumented side effect of giving the buffed unit evasion, likely in the 40-50% range. This is not true for FC and 3rd.)
Appendix A: Damage formula
Damage is determined as an affine function of total attack and total defense of the attacker and target respectively. The total attack is
TotalAttack = (Attack + AbilityBonus + ChainCorrection) * ElementalEffectivity
where for physical abilities
Attack = (STR + STR_Char * BuffValue) * (1 + STR_Up)
and magical abilities
Attack = ATS * 1.2.
Here, STR_Char is the base strength of the attacking character without equipment or quartz, AbilityBonus is the characteristic bonus added to the characters STR or ATS when performing a craft or an art (more info below). BuffValue is the relative effect of active buffs divided by 100 (eg. 0.2 if the attacker is affected by Estelle's Morale). ElementalEffectivity is the elemental susceptability of the target for the attacks element (cf. the targets entry in the monster guide) divided by 100. The ChainCorrection is only relevant in chain attacks and is 0, 0.1*Attack, 0.2*Attack, 0.3*Attack for the 1., 2., 3. and 4. participant in the chain respectively. STR_Up is the bonus given by STR_Up turns divided by 100 (0.1 or 0.5).
Similarly, we have
TotalDefense = Defense
where for physical abilities
Defense = DEF + DEFBuffValue * DEF_Char
and magical abilities
Defense = ADF + ADFBuffValue * ADF_Char
DEF_Char, ADF_Char and so forth are the defensive equivalents of the values defined above.
Damage then is calculated by
Damage = FixedDamage + RandomDamage
FixedDamage = (6 * TotalAttack - 5 * TotalDefense)/2
and RandomDamage equally distributed in the interval
[FixedDamage/15, 3 * (FixedDamage/15) - 1) .
The AbilityBonus for each art and craft can be found here and here. Normal attacks appear to have ability bonus 1 (or possibly 0, in which case the additional damage is likely caused by a rounding artefact). The AbilityBonus of S-Crafts scales with character level and is higher if the S-Craft is used with full 200 CP. For 100 CP S-Crafts,
AbilityBonus = (1 + CharacterLevel/100) * BaseAbilityBonus .
For 200 CP S-Crafts,
AbilityBonus = (1 + CharacterLevel/100) * BaseAbilityBonus * 1.5 .
Here, the BaseAbilityBonus is the value found in the tables above.