# Yanfly Critical Control question

#### jonthefox

##### Veteran
There's a field that says "Flat Critical Formula" and by default it has some formula that seems to add a bonus based on the user's luk and the target's luk.

If I were to remove the default formula, and instead put this: value += target.maxhp * 0.1

Would this make it so that on a critical hit, 10% of the target's maxhp is added to the damage? And would this damage be factored in AFTER the normal damage formula?

#### caethyril

##### ^_^

It's mhp, not maxhp; otherwise you have the right idea!

Code:
``value += ((baseDamage >= 0) ? 1 : -1) * 1.5 * user.luk + bonus;``
This says "if the skill does damage, start with a value of 1, else (healing) start with a value of -1; then multiply by 150% of the user's luk stat before adding any bonus flat crit". Actually, that's odd, I wonder why the bonus (from notetags) isn't being multiplied by +|- 1?

Anyway. So, if you're using any flat crit notetags then you may want to consider a formula like this instead:
Code:
``value += target.mhp * 0.1 + bonus``
...and if you have any crit-enabled healing skills, maybe extend that:
Code:
``value += ((baseDamage >= 0) ? 1 : -1) * (target.mhp * 0.1 + bonus)``
And yes, by default the flat crit is step 81 in Damage Core (prerequisite), whereas crit multiplier is step 31, so flat crit applies after crit mult unless you've changed that.

### Latest Profile Posts

I think I've created a monster.
...and I love it. <3
Today represents my one year anniversary of throwing out the tile map. One year ago my game looked like...

And now for those that don't know, it looks like..

What a year, what a year indeed. RIP Tile Map, nobody misses you.
There is now a demo released for [Beyond the Mirror]! Check the team recruitment thread to learn more!
Text is the limit.
'Tis the season to see shipping prices and go 'Yikes'.