Based on some data and calculations that I ran on mushrooms around Pioneer Colony, here's what I found:
mDam (from weapon) is multiplied by a "damage coefficient". This "damage coefficient" reflects the cast time (a spell with cast time 3 seconds also has a damage coefficient of 3). Note that the two, cast time and damage coefficient, are not the same thing, as effects that increase or decrease cast time do not affect the coefficient. You do NOT get a damage coefficient on the spell damage (from tooltip), however. This was tested by casting spells with the same tooltip damage with and without a weapon. Without weapon, spells with the same tooltip damage had the same power against the same enemy. Once I added in mDam, however, spells with higher cast times pulled ahead proportionately (a 2s spell did about 2x as much damage as a 1s spell).
I also determined that, when using mAtk/mDef in the formula, it would come out with inordinately large values for mushroom mDef. I refuse to believe that Pioneer Colony mushrooms have 800 mDef. My working theory is that Attack and Defense values are modified logarithmically in the formula, something more like Ln(mAtk)/Ln(mDef). This would make far more sense and using this formula, I pegged down the mDef of the mushrooms to just under 40.
The Heal Bonus under your magic stats heading is approx 48.9% of your mDam (it's based purely on your mDam stat. The "cure bonus" given by wisdom (0.2 bonus healing/wis) is a hidden stat not displayed in your character's stat listings. Both "heal bonus" (from weapon) and "cure bonus" (from wisdom) are subject to the "damage coefficient" mentioned above for magic attacks while spell effect (tooltip value) is not subject to the coefficient.
Wisdom gives a comparable mAcc value to Dexterity's pAcc value based on my testing. But considering what I figured on attack and defense values, I would venture to say that Accuracy vs Dodge is affected by a similar logarithmic adjustment and then applied to the base accuracy determined by level difference.
Stats derived from core stats (ie. pAtk from str) seem to be based purely off the active Primary class. This means that a class gets the same derived bonuses from their stats regardless of what their secondary is.
I'm still unclear on how elemental resistance factors in and there are little quirks in the system here and there. For example, the M/Wd lvl 15 elite, Earth Surge is supposed to have reduced accuracy. I'm not sure if skills in general have accuracy values; if they do, are they all the same? If not, is it just some special effect associated with Earth Surge in particular?