Add this to the BonusMod and you have what you want.
function SetAttackSpeed takes unit u,integer AttackSpeedToAdd returns nothing
local integer i = 0
loop
exitwhen i > AddAttackSpeedAbils
if GetUnitAbilityLevel(u,AddAttackSpeedAbil) > 0 then
//set AttackSpeedToAdd = AttackSpeedToAdd + IntPower(2,i) //This line has been disabled, that's the only difference.
call UnitRemoveAbility(u,AddAttackSpeedAbil)
endif
set i = i + 1
endloop
set i = AddAttackSpeedAbils
loop
exitwhen i < 0
if AttackSpeedToAdd >= IntPower(2,i) then
call UnitAddAbility(u,AddAttackSpeedAbil)
set AttackSpeedToAdd = AttackSpeedToAdd - IntPower(2,i)
endif
set i = i - 1
endloop
endfunction