Thank you for the provided details. Do we understand correctly that the current number of licenses is the number of users (and only users) that are members of the group?
In case of multiple groups, storing the limit in an AD property of a group is the best way as there will be just a single business rule and the groups will be specified in its Activity Scope. If you do not want the limit to be stored in an AD property, you can use one of Adaxes custom integer attributes (e.g. CustomAttributeInt1). The attributes are only available in Adaxes.