If the attacking creature loses its last shield counter at the same time it deals combat damage to a player (for example, if the attacking creature has trample and would be dealt damage by a blocker), then you will not be able to pay the cost of removing a counter when the triggered ability resolves.