damage formula help, using armor's attack value only

Spoiler: Solved, formatting error
Hello, how would I write a damage formula that uses only the attack value of my characters first armor piece, sans the weapons and innate physical attack values?

The equipment piece is the third total slot for equipment, and the first available slot for armor.

Alternatively, how can I save the attack value of an armor to a variable with a script?

I was using the following code for weapons, but seem to be running into an issue converting this to armor.

Code:
var weapon = DataManager.getBaseItem(a.weapons()[0]);
var value = weapon ? Math.floor(weapon.params[2] / 2) : 0;
$gameVariables.setValue(10, value);

var weapon = DataManager.getBaseItem(a.weapons()[1]);
var value = weapon ? Math.floor(weapon.params[2] / 2) : 0;
$gameVariables.setValue(11, value);


Looks like I was just missing adding an "s" to armor to get this working:

Code:
var armors = DataManager.getBaseItem(a.armors()[0]);
var value = armors ? Math.floor(armors.params[2]) : 0;
$gameVariables.setValue(19, value);

Then using a damage formula like:

(v[19] * 4) - (b.def * 4)

Original thread: https://forums.rpgmakerweb.com/threads/damage-formula-help-using-armors-attack-value-only.146972/