Forum:Adding Personal EditCount as a JS Variable

I'm trying to create a "Level" system to motivate users to edit, since I don't like the achievement system. The idea is to have a progress bar that resets every time you get so many edits, or "level up". For example, Level 1 will be 0 edits, Level 2 will be 1 edit, Level 3 will be 3 edits, Level 4 will be 6 edits, etc. The problem is, throughout all of the "wg" variables in the default Javascript, there is none for edit counts. So I set out to create one. I'm learning jQuery, don't know Javascript, and am stuck with the following results so far:

The idea is to import the number that's on their user page as a variable, which can be used to carry out functions for the rest of the project. The code is modified from a snippet I got from Wikia Staff a while back when trying to do the same thing:

As seen, this takes any element with the class "editcount" and loads in the user's number of edits from their Editcount page (user page in the case of my own code, above). Any ideas on whether/if this can be put into a variable for use in another function? Thanks. -Sherm/Talk