if I understand you correct, you want your user-class to have an attribute (Credits) of type number. This is easily done in the admin-interface.
Now, you can make an extension that consists of (at least) an template operator that increments the attribute.
See http://ez.no/community/forum/developer/how_to_update_an_attribute_of_an_object_with_php/re_how_to_update_an_attribute_of_an_object_wit__7 for some advice on manipulating an object with PHP.
See http://ez.no/community/contribs/template_plugins for examples of such extensions.