The user post count is stored in two places - in line 8 (index 7) of each user profile, and in the pc_index.cgi file in 6.4.0 and higher.
You should use GetPCdexAsHash and UpdatePCdex from lib_files to twiddle the pc_index... examples are available in the directory area of ubb_profile.cgi and the member rebuilding bits of cp_users. Modifying the user file is a simple OpenProfile/WriteMemberProfile affair... there are plenty of examples in the code.
However, I question your sanity a bit - one of the reasons we don't decrease user post counts is due to the potential load of removing a topic with a few dozen unique posters... though it shouldn't be a problem unless nuking entire topics will be somewhat common.
Always remeber that you can get a count of the user's current posts by counting the lines in the user post history file (members/user_posts/00000000.cgi), though that isn't a low load operation either...
--
Charles Capps
UBB.classic™ Developer
Having problems? Open up a support ticket!