Another way to see if a player will be removing a skill , as a pre-check and post check you can use the following. Since this is the popup they get before a skill is removed.
Code:
hooksecurefunc("StaticPopup_Show", function(event, skillName, skillLine)
if (event == "UNLEARN_SKILL") then
--do something here, but remember they haven't accepted yet, grab skillName and skillLine
end
end)
But if you want to grab the OnAccept of the dialog above you can do the following.
Code:
hooksecurefunc(StaticPopupDialogs["UNLEARN_SKILL"], "OnAccept", function(self, data)
--do something here
end)
To be honest AbandonSkill is the best way to do it. But just wanted to post another possible way of checking for player intentions.