Add additional button post menu

Thanks a lot, @zcuric, I’ve tried to get understanding of this plugin, and Retort also, yet no luck so far, but will continue in this direction.
Could you also, please, hint in what way Discourse manages render of Like button? Specifically, how does it hide Like button on your own posts? So I could do the same for my custom button.