That's possible, but what's the use case for it, considering abdications already trigger on_new_holder_inheritance?
The main reason I can think of would be if you have to deal with some weird special cases where you need to do something specific before a character is allowed to abdicate, e.g. destroying a certain title so that it doesn't end up in the hands of the new ruler (destruction
after someone gets it would at minimum mean they're in the title history, which would mess up regnal numbers if the person that briefly got it isn't supposed to count).
While not a straight example as it instead involves circumventing abdicate_to_most_liked_by using an if/else, we cannot
ever allow the use of normal abdication effects for the Tenno (Emperor of Japan) in Tianxia, seeing as there's no way to guarantee that the abdication isn't to someone belonging to another dynasty that's a claimant to Japan, and the Chrysanthemum Throne should
never pass into the hands of another dynasty. In a hypothetical scenario where we'd have wanted the relevant title be destroyed and normal abdication after that -- as opposed to using a custom scripted_effect to find a suitable member of the Imperial Family and then using abdicate_to targeting
that character -- an on_action/scripted_effect always firing prior to abdication would have been pretty neat.
On a tangential, but perhaps interesting note: A "fun" code quirk that posed similar problems for us is that if you have a secular rel head title (at least a kingdom tier one) and a higher primary tier title (at least an empire tier one) and a co-religionist usurps your primary (at least if it's the only primary tier title) the secular rel head title is
also usurped
even if the usurper isn't a claimant. We've consequently needed to set up a special workaround whenever a Shinto character usurps an empire held by the Tenno. It wasn't terribly messy to set this up after realizing what had to be done, but a before_usurping_my_titles and after_usurping_my_titles on_action/scripted_effect would theoretically have been useful.