LDP Critical Add on Support: Critical Hit Adjustment

There was a post years ago that covered this


The user posted an extra feature that did just this


A user posted this:
If you use Yanfly's Lunatic Damage, you can use this custom formula:

#---------------------------------------------------------------------- # Custom Critical Chance Formula # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Adjusts the attack's critical hit rate by the amount specified. # Formula notetag: # <custom damage: crit +x%> # <custom damage: crit -x%> #---------------------------------------------------------------------- when /CRIT+[ ]([\+\-]\d+)([%%])/i rate = $1.to_i * 0.01 @result.critical = (rand < rate) value += item.damage.eval(user, self, $game_variables)Yanfly Lunatic Damage: http://yanflychannel.wordpress.com/rmvxa/battle-scripts/lunatic-damage/

Yanfly Lunatic Damage - Critical Package (referenced to create the above formula): http://yanflychannel.wordpress.com/rmvxa/battle-scripts/lunatic-damage/ldp-critical/

I tried adding this to my yanfly critical script, but it kept giving me syntax errors...

is there a way to implement this...?
is there a way to implement this...?
That should be
Ruby:
#----------------------------------------------------------------------
# Custom Critical Chance Formula
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Adjusts the attack's critical hit rate by the amount specified.
# Formula notetag:
# <custom damage: crit +x%>
# <custom damage: crit -x%>
#----------------------------------------------------------------------
when /CRIT+[ ]([\+\-]\d+)([%%])/i
rate = $1.to_i * 0.01
@result.critical = (rand < rate)
value += item.damage.eval(user, self, $game_variables)
Thank you for your help

Original thread: https://forums.rpgmakerweb.com/threads/ldp-critical-add-on-support-critical-hit-adjustment.134714/