I created something similar once that may help. In my world, dummy players named for the teams scored a point any time a player on the corresponding color team died. Perhaps you could substitute in an experience level of 1? My system works with a clock, so it is not triggered with a button. I tried to keep the entire thing close enough to spawn at it would stay loaded. I attached screenshots.
I had the following variables:
playerDeaths - deathCount
playerDeaths2 - dummy
teamDeaths - dummy
The command block and 3 wool in the foreground make up the clock. The command is:
testfor @a[score_playerDeaths_min=1,team=Blue] // Try replacing with lm=1
The background CBs do "the math" automatically. Going counter-clockwise, starting from the bottom, the commands are:
/scoreboard players remove @a[score_playerDeaths_min=1,team=Blue] playerDeaths 1 //This removes the death from the deathCount variable. You could do /xp -1L @a[lm = 1]
/scoreboard players add @a[score_playerDeaths_min=1,team=Blue] playerDeaths2 1 // This adds a point to the dummy variable for individual scores. You may not need it.
/scoreboard players add BlueTeam teamDeaths 1 // This adds a point to the team score
If I setDisplay to playerDeaths2, I can see individual scores, even though the deathCount variable will just keep going back and forth between 0 and 1.
If I setDisplay to teamDeaths, I can see the total accumulated deaths per team.
I'm not sure if this will give you the solution you want but it's another approach that might be worth exploring. Good luck,
Mike