Critical Hit gives magic damage bonus?

I'd like to make it so that in my game, if you manage to get a critical hit, it increases only magic damage (or at least increases it more than normal damage). Essentially, there will be some weapons with a high magic damage, and essentially these have a low "minimum damage" but a high "maximum damage".

Is anyone aware of how I'd go about doing this?
One possibility is to use http://yanfly.moe/2016/10/17/tips-tricks-critical-hit-effects-rpg-maker-mv/ as a basis for this. You could, rather than using it to create buffs, have the effect stack the damage with a second more magical effect.


Alternatively, and possibly easier, would be to rather than use specifically critical hits, use http://yanfly.moe/2015/12/26/yep-51-weapon-unleash/ to create a secondary strike that has X% chance of happening that instead deals magical damage, which would allow your weapon to deal extra damage if you're lucky.
l don't know what magic damage is, I'm guessing it's an element


<Post-damage eval>


if (result.critical && value >= 1) {


target.gainHp(Math.floor((-value * 0.50) * target.elementRate(X))) }


</Post-damage eval>


will do 50% more "magic" damage when it's a critical strike

Original thread: https://forums.rpgmakerweb.com/threads/critical-hit-gives-magic-damage-bonus.71884/