I'm not 100% sure about this, since I haven't tested all of it myself. But as far as I know, to calculate the true damage you have to follow this equation:
true_damage = base_damage * damage_multiplier * crit_multiplier * total_mitigation
with:
a) base_damage = skill_coefficient * (base_magicka * sum_of_mag_buffs + base_spell_dmg * sum_of_spell_buffs * 10.5)
Of course for stamina abilities you have to look at stamina and weapon damage. Magicka buffs are for example the undaunted mettle passive or the mages guild inner light buff. Spell damage buffs are for example the sorcery buffs, or the sorcerer expert mage passive.
Note however, that some skills don't follow this rule and only take max magicka, max stam or even max health into consideration.
b) damage_multiplier = 1 + sum_of_damage_buffs - sum_of_damage_debuffs
Generally speaking, these damage buffs are all buffs that increase damage by a certain percentage. Most prominently are the berserk buffs, but the warden advaced species passive is another example.
Damage debuffs are all beduffs that decrease your damage by a certain percentage. These are called minor and major main in game.
c) crit_multiplier = 1.5 + sum_of_crit_buffs - (target_crit_resistance / 6800)
An important thing to consider here is that as far as I know this can never become smaller than 1, so landing a crit on a target with extremely high crit resistance will still do at least non-crit damage. Crit buffs are all that increase critical damage by a certain percantage, for example minor force, shadow mundus, or the templar piercing spear passive.
d) total_mitigation = (1- (target_true_resistance * (1 - ignore_resistance_multiplier) - total_penetration) / 66000) * (product_of_target_mitigation_buffs + sum_of_damage_taken_debuffs) * (1 - target_block_mitigation)
Note, that with true target resistances I mean the targets base resistance plus the sum of the targets resistance buffs (major and minor resolve) minus the sum of resistance debuffs (fracture and breah). The 'ignore resistance multiplier' is a special case in game and only applies to the dual wield twin blade and blunt as well as the 2h heavy weapons passives in case of maces/mauls).
Target mitigation buffs are all buffs that reduce the targets damage taken by a certain percentage, for example the protection buffs or the vampire mistform skill. It is very important to note that in contrats to basically all other buffs/debuffs the product of one minus mitigation buffs are calculated here instead of the sum.
--> product_of_target_mitigation_buffs = 1 * (1 - mitigation_buff_1) * (1 - mitigation_buff_2) * (1 - mitigation_buff_3) * (...)
Damage taken debuffs are all debuffs that increase the targets damage taken by a certain percentage. Those are for example the vulnerabiliy debuffs, or the dragonknight engulfing flames debuff. However, I must admit that here I'm not really sure if the sum or product is calculated. It could be:
---> sum_of_damage_taken_debuffs = damage_taken_debuff_1 + damage_taken_debuff_2 + damage_taken_debuff_3 + ...
or
--> product_of_damage_taken_debuffs = (1 + damage_taken_debuff_1) * (1 + damage_taken_debuff_2) * (1 + damage_taken_debuff_3) * (...) - 1
If anbody knows for sure, please let me know.