It doesn't matter wether you use gold,lumber,items with charges,leaderboard, or whatever else you can come up with.
It will still take your ammo when you are starting to shoot because the event "A Unit is Attacked" refers to when the unit STARTS to attack.
If you want him to actualy attack you need a damage detection system.