Use code to reduce Hit Rate

Hello all,

I'm trying to create a passive state for yanflys Row_Formations plugin. Essentially if you have a ranged weapon (Bow or Crossbow) and are in row 2 then your accuracy is reduced. what is the code for reducing the users Hit rate?

Thanks in advanced!
rowState2.png
Can't you just reduce the Hit Rate in the Traits section?

I've moved this thread to Plug-In Support. Thank you.

@bgillisp But the code I need is from the base game engine(specifically how to alter hit rate in code form instead of using the traits option). The plugin is working fine no issues.

And I can't use the default traits because hit rate changes based on the weapon the user has. I have to Manuelly change it with script to get different reductions
You may use this plugin from Yanfly: http://yanfly.moe/2016/03/20/yep-85-hit-accuracy/
and check for ranged weapon and row in the hit formula
Right, but requests for code are under the Javascript forum, which is the same as Plug-in support (notice it says JavaScript/Plug-in Support). Hence why it goes here.
Oh ok makes sense thank you. Appreciate it.
NP. And just know that the blue text is so you know a moderator moved it more than anything. And I actually wish I had known the code too as I could have told you and moved it, but I use ACE right now so what I know about MV's JavaScript I could write on a matchbook cover.
lol that's ok. Thanks for the help though, I might try the workaround Eldaym suggested.

Original thread: https://forums.rpgmakerweb.com/threads/use-code-to-reduce-hit-rate.92470/