Mind blast checks the targets stats and determines which stat is the highest and lowest then determines the difference between the two. This number is halved and checked to make sure it is not more than 40 damage. Should the target player pass a resist check the damage would be halved.
Example 1: Str: 100: Dex:25 Int:100, Highest Stat 100, Lowest Stat 25, Difference:75
Result 1: Damage:37, Resisted Damage:18
Example 2: Str: 100: Dex:25 Int:110, Highest Stat 110, Lowest Stat 25, Difference:85
Result 2: Damage:40, Resisted Damage:20
Example 3: Str: 90: Dex:45 Int:90, Highest Stat 90, Lowest Stat 45, Difference:45
Result3: Damage:22, Resisted Damage:11
As you can see balanced stats are critical when mitigating the damage from the mind blast spell.
Formula: (Highest Stat - Lowest Stat) / 2