Yes there is but it will be risky. First of all, you have to know that dead units don't have buffs. Conclusion, you can't search for buffs once they are dead, only when they are attacked. Check everytime an unit is attacked, and it has your buff. Wait 1 second, check if the unit is dead and then do whatever you want to do. This is a bit risky because the buff might remove in that 1 second. But its the only method I could think of right now. If you don't use JASS atleast.
Well, that's the whole point. You can do it like this:
Have a trigger which activates when the target is affected by the spell, and of course, deactivate it when the buff disappears. Now, the trigger's event is "An Unit Dies" and "Dying Unit" is equal to Target (variable which stores the "Target Unit of Ability Being Cast"). That's Telefragged idea in a nicer way and of course, it would be fully implementable in JASS. Why don't you try my JASS tutorial?
Look out you could get caught for flaming yourself! Seriously though, depending on what you want it to do you could use doom, unit spawns a unit, spawned unit equal to <a dummy unit>, then do actions. Easy. Just remember to remove the dummy unit! JASS is not the only way.