You can change the icon programmatically using the @icon command modifier.
I use this in the external compare and merge tools script. Where the user needs to provide the executable path for the selected compare tool. The path is stored in a global variable.
The default icon for the button is grey, if the global variable is set when you hold down the button it will show a colour icon, indicating it has a path.
The command for the buttons looks like this.
@icon:#ExternalCompare:BeyondCompare3,$glob:ExternalCompare+BeyondCompare3
ExternalCompare Product BeyondCompare3
Not sure if it can do what you want, but might get you on the right path. As you can control the icon with a variable, and you can set the variable in a script.
Your button might look like
@icon:#Downloads:Count1,$glob:DownloadsCount1
@icon:#Downloads:Count2,$glob:DownloadsCount2
@icon:#Downloads:Count3,$glob:DownloadsCount3
...