What you're asking for is exactly what an affiliate tracking system is. I suggest looking into iDevAffiliate or Post Affiliate Pro as both integrate with CBSubs. Otherwise you're basically going to have to rig together your own affiliate system using various plugins, which may not be entirely reliable. There is a trigger fired based off plan subscription status as shown below.
Plan Active
Global
Triggers: onCPayUserStateChange
User: Automatic
Access: Everybody
Conditions
1: [var3] Equal To PLAN_ID_HERE
2: [var2] Equal To A
Plan Expired
Global
Triggers: onCPayUserStateChange
User: Automatic
Access: Everybody
Conditions
1: [var3] Equal To PLAN_ID_HERE
2: [var2] Not Equal To A
However, it has no idea they were invited to join the site and if you conditioned off the invite_code field you'd still have no idea who invited them, which would be necessary to increment the field of the user who invited them. You could probably grab that information using a CB Query Field based off the value of the invite_code field and then you'd substitute in the query field. So I guess something like the below.
Query Field:
Code:
SELECT `user_id` FROM `#__comprofiler_plugin_invites` WHERE `code` = '[invite_code]'
That'd give you the user id of the person that invited them if you're using the invite code field on registration. You'd then use the below auto action to increment when their subscription became active.
Global
Triggers: onCPayUserStateChange
User: Automatic
Access: Everybody
Conditions
1: [var3] Equal To PLAN_ID_HERE
2: [var2] Equal To A
Action
Field: YOUR_INTEGER_FIELD_HERE
Operator: Add
Value: 5
Translate Value: No
User: [YOUR_CODE_FIELD_HERE]