Also, simply saying "If I were two years younger" also works, as it insinuates that you are comparing it to your present age.
"I'm 18. If I were two years younger, I wouldn't be allowed to smoke"
If you want to be more specific, then you can compare your age to something else.
"If I were two years younger than you..."
"If I were two years younger than I am now..."
You can also say
"Two years ago, I would have...."