I'm not sure why your game crashes, but I can see why this wouldn't work. The display buff is not meant to be applied directly, but by the poison buff. That is why it is a REFCOUNT buff: it keeps track of how many poison buffs are on the unit.
Using the library I wrote previously, your spell would look something like this:
library shadowheart initializer Init requires ABuff, Poison, IntuitiveDamageSystem
private constant integer abiID = 'A009'
private constant integer bufID = 'B004'
private function con takes nothing returns boolean
return GetUnitAbilityLevel(GetTriggerUnit(), bufID) > 0
private function act takes nothing returns nothing
local unit c = GetTriggerDamageSource()
local unit t = GetTriggerDamageTarget()
local player p = GetOwningPlayer(c)
local integer lvl = GetUnitAbilityLevel(c, abiID)
call UnitRemoveAbility( t, bufID )
call ABuffApply( Poison_bufftype, t, c, 4.0, lvl, 0 )
set c = null
set t = null
set p = null
private function Init takes nothing returns nothing
local trigger trg = CreateTrigger()
call TriggerAddAction(trg, function act)
call TriggerAddCondition(trg, Condition(function con))
call TriggerRegisterDamageEvent(trg, 1)