Currently, ocf:pacemaker:attribute can handle unique clones as far as using a unique state file for each instance on a node, but all instances will use the same attribute name, which means that check_attribute won't be able to distinguish a started instance from a stopped instance.
Add the capability to set the attribute value to the number of active instances rather than a specific value (for the user interface, maybe something like a new count=true parameter that could be used instead of active_value and inactive_value). Then the agent can set the attribute to "name++" on start and "name+=-1" on stop (using crm_attribute --score).
An example use case would be interleaving an anonymous clone with a unique clone. The anonymous clone could have a location constraint enabling it on any node where name > 1 (or however many instances it requires).