Adding a button to the tollbar

I want to add a button to the toolbar performing two actions : a) Select an attack number from a sub menu and saving then the value to a global property or somewhere: b) Select the type of attack and saving then the value to a global property or somewhere.
If this is possible how I can do? I didn’t find similar question on the forum. Sorry for this question, but I am a newby in module design. :question: