https://wow.gamepedia.com/SecureActionButtonTemplate
If you want the blizzard art and stuff you can inherit from ActionButtonTemplate again, but you'll need to do most of the event handlers yourself, since blizzards handlers will most likely assume the button is using an action slot.
https://github.com/tomrus88/Blizzard...onBarFrame.xml
https://github.com/tomrus88/Blizzard...tionButton.lua
if you want to have drag/drop you'll need to simulate PlaceAction() which does a bit of the lifting for the default action buttons, you'll have to process whatever the cursor is holding, and configure the frame attributes accordingly.
when assigning the hotkey you can just bind it to click the frame, or just perform the intended command directly.