Hi All, I've just started trying to make my own custom character sheet. All has been going well (its been a good 10 years since I last dabbled in HTML and javascript). But I've become stuck trying to automate things a little too far maybe. What I'm trying to do is write a function that can update any attribute when you pass it in the name of the attribute and the value you want to change it by. I could write specific code for each attribute "hardcoded" (which would mean once for every skill and weapon skill, so lots of repeated code), but I would prefer to only have to write it once at a generic level and use that instead. So for my test case, I have a checkbox, when ticked it will change the value of the Defence Modifier attribute by 20, then unticking it will remove the 20. Ive got this working if I "hard code" the names of the attributes, as seen below... on("change:hasshield", function(eventInfo) { console.log("************ Has Shield Changed ************"); var isChecked = eventInfo.newValue; getAttrs(["defenceOtherMods"], function(pvalue) { var otherMods = parseInt(pvalue.defenceOtherMods); //If the box has been ticked, add the shields modifier if (isChecked == 1) { otherMods = otherMods + 20; } else { //Shield isn't ticked, so remove the bonus otherMods = otherMods - 20; } setAttrs({ acrobatOtherMods: otherMods}); }); }); As I said what I want to be able to do is write a function that takes the name of the skill and value and updates that attribute, as shown below: <script type="text/javascript"> on("change:hasshield", function(eventInfo) { console.log("************ Has Shield Changed ************"); var isChecked = eventInfo.newValue; //If the box has been ticked, add the shields modifier if (isChecked == 1) { updateSkillsModifiers("defence", 20); } else { //Shield isn't ticked, so remove the bonus updateSkillsModifiers("defence", -20); } }); //Update the given skill's otherMods value by the value given function updateSkillsModifiers(skillToUpdate, value) { var skillName = skillToUpdate + "OtherMods"; //PROBLEM LINE ! will getAttrs([skillName] actually work or does it need to be a "written" string getAttrs([skillName], function(pvalue) { console.log("Skill to update is " + skillName); var otherMods = parseInt(pvalue.skillName); console.log("othermods is " + otherMods); //Update the modifier value by the value given otherMods = otherMods + value; //PROBLEM LINE ! Dont know how to use the var skillName instead of having to actually right the whole attribute setAttrs({ defenceOtherMods: otherMods}); updateAcrobatTotal(); }); } As you can see there are two issues that I'm finding. 1) Will getAttrs([skillName] actually work when using a string variable or does it need to be a "written" string? (hope that makes sense) 2) I don't know how to use the var skillName instead of having to actually right the whole attribute out again. So I'm wondering is there a way to do the above or am I trying the impossible? Thanks!