I have a modifier for legion's moment of courage, added likewise:
function modifier_legion_commander_pf_moment_of_courage:OnAttackStart(event)
if IsClient() or event.target ~= self:GetParent() then return end
local hTarget = event.target
local hAbility = self:GetAbility()
if not hAbility:IsCooldownReady() or hTarget:PassivesDisabled() or not RollPseudoRandomPercentage(hAbility:GetSpecialValueFor("trigger_chance"), DOTA_PSEUDO_RANDOM_LEGION_MOMENT, hTarget) then return end
hTarget:AddNewModifier(self:GetCaster(), hAbility, "modifier_legion_commander_pf_moment_of_courage_lifesteal", {duration = self.nBuffDuration})
end
lasts for 1 second, and is succesfully created, the lifestealer modifier has an OnAttack function, it works in tools/localhost, but breaks on dedis? will post second part in comments