Can You Use VisuMZ Battle Core to Change How to Calculate Hitting and Criticals?

So, I'm trying to make a sort of... "tabletop style" system for combat. Basically, I've managed to use a couple plugins to create Strength, Dexterity, Constitution, etc. for all of the characters and monsters. So, now I'm trying to figure out how to make the game "roll a d20" and determine a hit, miss, or crit. I've technically done this entirely in the "Damage Formula" system... but it's still also using the normal formula to determine a hit and a crit. Unfortunately, I don't understand the other sections well enough to understand how to edit them. Here's the damage formula system I made, if it helps.
JavaScript:
// Define Constants
const user = this.subject();
const target = arguments[0];
const item = this.item();
const a = this.subject();
const b = target;
const sign = [3, 4].includes(item.damage.type) ? -1 : 1;
const note = this.item().note;

// Check for Hit
let armor = 1;
if (note.match(/<REFLEX>/i)){
    armor = b.dex;
} else if (note.match(/<FORTITUDE>/i)){
    armor = b.con;
} else if (note.match(/<WILL>/i)){
    armor = b.int;
} else {
    armor = b.def;
}
armor = this.applyArmorModifiers(b, armor);
console.log("armor = " + armor);

let attack = a.atk;
let diceRoll = Math.floor(Math.random() * 20);
console.log("Dice Roll: " + diceRoll);
let toHit = 0;
toHit = diceRoll + attack;
console.log("To Hit = " + toHit);

// Create Damage Value
let value = 0;
let damageRoll = Math.floor(Math.random() * (item.damage.formula - 1) + 1)
if (diceRoll == 1) {
    value = 0;
} else if (diceRoll == 20) {
    value =  damageRoll * 3
}
if (toHit >= armor){
    value = damageRoll
} else {
    value = 0;
}
console.log("Damage: " + value);

// Return Value
return isNaN(value) ? 0 : value;
There are a number of threads discussing how to do this.

The damage formula is not the correct place to try to put attack rolls, as the default engine has already determined hit/miss/evade at that point.

When you use notetags, there's the built-in meta functionality rather than having to do string manipulation.

Anyway...I made a plugin for changing the hit formula, it's been reported so far that it's compatible with VisuStella plugins.
Just a theory here, but since you're already using your own damage formula, you could potentially just disable critical hits chance in the database (set everything to 0) and set a dice roll of 20 = a x2 multiplier on an attack or spell.
since you're already using your own damage formula, you could potentially just disable critical hits chance in the database
Yes, that's the right track - but if the OP really wants to emulate the D&D mechanics, she'd have to use a hit formula plugin, set a switch in that when it rolls a 20, and then reference that in the damage formula.

Original thread: https://forums.rpgmakerweb.com/threads/can-you-use-visumz-battle-core-to-change-how-to-calculate-hitting-and-criticals.163040/