Damage taken gained as Mana - How does it work with "Mind over Matter"?

As in the topic, how does it work / how much mana will you gain, having Mind over Matter?

Details about the question:

  • An example for "X % of Damage taken Gained as Mana when Hit": Unique Mindspiral http://pathofexile.gamepedia.com/Mindspiral abbreviated: %DtM
  • Mind over Matter is a Keystone and grants: "When Hit, 30 % of Damage is taken from Mana before Life": http://pathofexile.gamepedia.com/Mind_Over_Matter abbreviated MoM

To find the answer, the question is also: Which is calculated first %DtM or MoM?

Simple Example:

  • 100 incoming damage and we have no mitigation
  • We have 10 % DtM
  • We have MoM

There are 2 general possibilities which I see:

  1. %DtM first: 100 damage gets you 10 mana first, then deals 70 damage to life and costs 30 mana
  2. MoM first: 100 damage deals 70 damage to life and costs 30 mana, first. This results in 7 mana gained (10% of 70 damage to life)

%DtM happens first. Scenario 1 is mostly correct. To be technically correct, 100 damage gets you 10 mana, then deals 100 damage, 70 from life and 30 from mana.

The only reason this actually matters is for situations in which you are low on mana, or full. If you only have 20 mana in scenario one, you take 20 damage to mana, then 80 to life. By applying %DtM first, you gain that 10 extra mana so that it can be taken by MoM. However if you are full on mana, you can't gain the 10 bonus, so it is simply lost.

Scenario 2 is wrong because you don't take 70 damage with MoM, you take 100 damage. It just subtracts from two different pools.

As an aside, if you had 100 energy shield, that damage is absorbed by the shield and doesn't trigger MoM, so you would lose the 100 ES, and nothing from mana.