Block Chance Plugin [UPDATED Version 1.2]

Oggy_Block.js
Author: Oggy
Rpg Maker MZ
Plugin Version 1.2​

The aim of this plugin was to add block chance to an RPG Maker MZ project. I figured others might want to use it or edit it to their needs.

Information:
- This plugin uses rates for block chance and the damage reduction.
- It currently only works for Physical attacks.
- It separates miss and evade so that they have separate messages.
- It will give a message and popup "Block" when blocking and popup "Evade" when evading. Miss will still pop up "Miss".

How to Use:
1. Install the plugin into your plugin manager.
2. Make 2 rates in the "Types" section of the database in MZ. One for chance and one for damage reduction.
3. Configure the plugin. Put the ID of the rate you made for block chance and damage reduction into the plugin parameters.
4. Then just add the block chance rate and Damage Reduction to whatever you want.
5. Block Chance rates go from 101 - 200% (101 = 1% and 200 = 100%)
6. Block Damage Reduction is done 2 ways. First, base value between 0-100%. Second, mod value numbers 101%+.

This plugin has variable uses:
If you want to use it as a second avoidance, no problem. Just add Block Chance to actor, class, state, or armor type, but do not add Block Damage Reduction and you will have a chance to take no damage in addition to evade.

If you want to use it on just armor types that's possible too. Using one armor type, for instance shields, you would add Block Chance to the shield and add the Base Damage Reduction to the shield. (1-99%)

If you want to use multiple Block Damage Reductions you can. Your first Damage Reduction must be the base (1-99%). Then any additional reductions will be multipliers (101%+).
Example: Actor/Class/Armor type has a base Damage Reduction of 10% and an accessory has boosts the amount of reduction by double you would add 200% Block Damage Reduction to the accessory.

Compatibility:
I have no clue on the compatibility of this plugin with other plugins, other than it currently does not work in VS Battlecore.

Terms:
Free to use or edit in commercial or non-commercial projects with credit to Oggy.
Why hijack cev rather than making another property on battlers and allowing the user to set values via notetag?
Because I wrote it for my project and 1.) I don't use crit evasion 2.) My js skills are not good enough yet to make a custom stat. Maybe as I get better at js I'll try to make it its own stat.

I thought it could be useful to some.
is the blocked amount customizable, or is it just a flat out 100% damage block?
The raisin I ask is because it feels..... I don't want to say redundant, but, if evasion already completely prevents damage from being taken, why would a second stat be necessary that does the same thing?
I've always liked the way Blocks are handled in World of Warcraft, where blocked attacks reduce incoming damage by an amount equal to another stat (your block value). Maybe you're fighting a boss who commonly hits for 1000 damage, but when you block, you reduce the incoming damage by 50%, so you only take 500 on a block, for example.
Currently no. It just acts as a second chance avoidance check assuming an actor has the stat.

But that is probably something I could add in at some point.
Updated to Version 1.1!
Thanks to feedback and a lot of JS reading, I have made some adjustments to the plugin.
1. It no longer overrides Critical Evasion. It now does it via Element Rates.
2. You can now set a damage reduction amount for blocking. (0 - 100%) At 100% it will function as if the attack was avoided. Also, controlled by Element Rates.
Version 1.2
-Fixed the everybody blocks without the rate. The new Block chance rates go from 100% - 200%.
Essentially if the Block rate isn't present or set to 100% it is 0% and 200% is the 100%

- Also changed the log message to not include the word shield. So now a partial damage reduction block will say name blocks some of the damage! and a full block will say name blocks the attack!

Original thread: https://forums.rpgmakerweb.com/threads/block-chance-plugin-updated-version-1-2.164413/