Lets's say you created an action button like the above, named reduce, here's an example worker that reduces a bunch of defined attributes by 1 each, when the button is clicked. on ('clicked:reduce', function () {
// make an array of the attributes you plan to adjust, for ease of use later
const attributes = ['list of attributes to adjust'];
getAttrs(attributes, function(values) {
const settings = {}; // make a variable to hold the changed attributes
// loop through the attributes, get the value, then subtract 1
attributes.forEach(att => { // in each go through the loop, "att" becomes the next attribute
let tempattribute = +values.att || 0;
tempattribute -= 1;
// store the changed attribute in the settings variable:
settings[att] = tempattribute;
}):
// save the updated attributes to the sheet
setAttrs (settings);
});
});