Think I found it
In the second and third
elseif(preg_match("/-6-/",$Groups)) {
You are missing the { at the end.
Any time you do any kind of an "if, else, or elseif" statement, the whatever happens if it's true needs to be between { and }
Maybe I left em out somewhere.
I sometimes forget them here and there. Pain to track down sometimes.
I think the file I've attached to THIS post should do it for you.
Let me know.
I've accounted for the Birthday mod as well.