I'm struggling to understand what I'm doing wrong in this script. While I don't really think it is "too long" it works when I make it shorter! The sheetworker is for a Traveller: The New Era sheet I'm working on. The system tracks damage to hit locations and each location can have "scratch", "slight", "serious" or "critical" damage. Penalties are imposed based on the most severe damage level across all locations. If I cut out parts of it, the parts I keep work. But if I keep all the code it is only able to recognize "serious" and "critical" damage levels. This is the code I'm currently using: on("change:head_status change:chest_status change:abdomen_status change:left_arm_status change:right_arm_status change:left_leg_status change:right_leg_status", function() { getAttrs(["head_status_level", "chest_status_level","strength_max", "abdomen_status_level", "left_arm_status_level","right_arm_status_level","left_leg_status_level","right_leg_status_level"], function(pvalue) { var head_status_level = parseInt(pvalue.head_status_level); var chest_status_level = parseInt(pvalue.chest_status_level); var abdomen_status_level = parseInt(pvalue.abdomen_status_level); var left_arm_status_level = parseInt(pvalue.left_arm_status_level); var right_arm_status_level = parseInt(pvalue.right_arm_status_level); var left_leg_status_level = parseInt(pvalue.left_leg_status_level); var right_leg_status_level = parseInt(pvalue.right_leg_status_level); var left_leg_status_level = parseInt(pvalue.left_leg_status_level); var strength_max = parseInt(pvalue.strength_max); var half_strength = Math.floor(strength_max/2); var strength; if (head_status_level == 4) { damage_initiative_penalty = "5"; strength = 0; } else if (chest_status_level == 4) { damage_initiative_penalty = "5"; strength = half_strength; } else if (abdomen_status_level == 4) { damage_initiative_penalty = "5"; strength = half_strength; } else if (left_arm_status_level == 4) { damage_initiative_penalty = "5"; strength = half_strength; } else if (right_arm_status_level == 4) { damage_initiative_penalty = "5"; strength = half_strength; } else if (left_leg_status_level == 4) { damage_initiative_penalty = "5"; strength = half_strength; } else if (right_leg_status_level == 4) { damage_initiative_penalty = "5"; strength = half_strength; } else if (head_status_level == 3) { damage_initiative_penalty = "3"; strength = half_strength; } else if (chest_status_level == 3) { damage_initiative_penalty ="3"; strength = half_strength; } else if (abdomen_status_level == 3) { damage_initiative_penalty ="3"; strength = half_strength; } else if (left_arm_status_level == 3) { damage_initiative_penalty ="3"; strength = half_strength; } else if (right_arm_status_level == 3) { damage_initiative_penalty ="3"; strength = half_strength; } else if (left_leg_status_level == 3) { damage_initiative_penalty ="3"; strength = half_strength; } else if (right_status_level == 3) { damage_initiative_penalty ="3"; strength = half_strength; } else if (head_status_level == 3) { damage_initiative_penalty = "1"; strength = strength_max; } else if (chest_status_level == 2) { damage_initiative_penalty = "1"; strength = strength_max; } else if (abdomen_status_level == 2) { damage_initiative_penalty = "1"; strength = strength_max; } else if (left_arm_status_level == 2) { damage_initiative_penalty = "1"; strength = strength_max; } else if (right_arm_status_level == 2) { damage_initiative_penalty = "1"; strength = strength_max; } else if (left_leg_status_level == 2) { damage_initiative_penalty = "1"; strength = strength_max; } else if (right_leg_status_level == 2) { damage_initiative_penalty = "1"; strength = strength_max; } else { damage_initiative_penalty = "0"; strength = strength_max; } setAttrs({damage_initiative_penalty,strength}) }); }); The "_status_level" attributes correspond to the damage levels described above. And there is probably a lot of things that is redundant and/or could have been done better - I don't really understand what I'm doing here...