How can I turn this cipher into a perfect cipher by altering only its encryption algorithm?
Two ways to go about it:


Enlarge the key space so that every possible ciphertext is equally likely.
Change the operation from XOR to one that stays in the set of the three values you have.


Either would work, but since you asked for hints I will leave the specifics for you.