//Plugin by Goinza //Sample code used as reference on Chapter 2: Custom Skills (function() { //If the unit has the "AlwaysDouble" skill, it will have 2 rounds of combats. //active: the attacking unit //passive: the defending unit //weapon: the equipped weapon of the active unit var alias1 = Calculator.calculateRoundCount; Calculator.calculateRoundCount = function(active, passive, weapon) { var rounds = alias1.call(this, active, passive, weapon); var skill = SkillControl.getPossessionCustomSkill(active, "AlwaysDouble"); if (skill!=null) { //Unit has the skill rounds = 2; } return rounds; } //Gets more attacks if the unit has the skill "MoreAttacks" //active: the attacking unit //passive: the defending unit //weapon: the equipped weapon of the active unit var alias2 = Calculator.calculateAttackCount; Calculator.calculateAttackCount = function(active, passive, weapon) { var count = alias2.call(this, active, passive, weapon); var skillArr = SkillControl.getDirectSkillArray(active, SkillType.CUSTOM, "MoreAttacks"); var extra = 0; var skill; for (var i=0; i