I was just wondering if this was possible because i started using ternary operators to reduce lines of code and i am loving it.
if (x==y) { z += x; } els
You can use
z += x == y ? x : x == z ? y : 1;
But honestly, that's not really more readable than what you had before. You can make it slightly clearer by adding parentheses:
z += x == y ? x : (x == z ? y : 1);
But generally I'd stay away from nested conditional operators unless when golfing.