Short anserw: After.
Long anserw: There is a strict mechanics on how damage is calculated, as follow:
1. Initial damage
Damage sources have a base damage that can be increased by various stats. Stats are only applied once per calculation.
• Flat damage
- Local modifiers apply to base damage on the relevant source, for example most modifiers on weapons.
- Added damage to attacks or spells from equipment and support gems.
• Damage Conversion
- Added as modifiers adds a percentage of one damage type as another damage type, for example
Gain #% of Physical Damage as Extra Cold Damage during effect
You and nearby allies add #% of your Physical Damage as Cold Damage.
- Converted to modifiers changes one type of damage into another, for example
#% of Cold Damage Converted to Fire Damage.
• Global modifiers
- All increased and reduced modifiers are additive.
- All more and less modifiers are multiplicative.
Converted damage can take benefit of bonuses for the damage type it was before and what it converted into.
•Critical strike roll
Hits can be rolled as a critical strike which multiplies the damage by 150% by default.
2. Preventing the hit
• Evasion of attacks.
• Dodge and Spell dodge.
3. Damage Shift
Incoming, damaging hits can be shifted to another damage type. It is usually done by utilizing an item which offers the
#% of X Damage taken as Y modifier
It is important to note that this is not damage conversion, as shifted part of damage does not retain its original damage property so it won't get mitigated either twice or by the more favorable method. For example, if some of the incoming damage is shifted to or from physical, the after-shift value is used in the armour calculation.
4. Damage Mitigation
• Damage can be avoided, with some items or skill. Avoiding damage stops the damage of a hit. It still counts as a hit, even if it only is 0 damage.
• Elemental and chaos damage is mitigated by its respective resistance. ( Here is where your Resistance's damage reduction take place. )
• Physical damage is mitigated by the sum of all #% additional Physical Damage Reduction modifiers, up to its 90% cap.
5. Damage Taken
After damage mitigation, modifiers to damage taken are applied. Flat amounts are applied first, then the sum of all increases/reductions and lastly with more/less multipliers applied separately.
5. Blocking the damage
• Block and Spell block.
6. Taking the final damage
#% or # of Damage is Taken from # Before Life/Energy Shield
( Here is where you Magna Eclipsis's Elemental Aegis take the damage for you. )
• Non-chaos damage damages energy shield protecting life until it's depleted, by default.
For Mind over Matter users, #% of the remaining damage is removed from mana. Mind over Matter only applies if the damage is affecting life.
• Chaos damage always bypasses energy shield. This applies regardless if energy shield is protecting life or mana.