From Dark and Darker Wiki

< Scaling for bolt of darkness

I believe the way it works is: Each spell has a base amount of damage (such as Bolt of Darkness doing 15). The Magical Damage stat you see on Spellbooks, Magical Staff', and Crystal Balls, are added to the base damage of the spell you cast. I.E. Bolt of Darkness with the warlocks starting gray Staff will do 20 base damage. That damage will then be multiplied by Magic Power Bonus (the 164% in your example). Additional Magic Damage that you get on gear is not multiplied by you MPB, it is just added on at the end (although it should still be effected by headshot multiplier of 1.5), so the Bolt would do:

(((20base × 1.64) + 20 Additional damage) × body multiplier)