Let's compare these two:
You could tell him if you want.
You could tell him if you wanted.
Both sentences are timeless. They don't necessarily occur (although they could if context is given) in the frame of a past, present, or future. The only difference is that the second implies that "it appears that you don't want to tell him".
Now let's compare these two:
You could have told him if you wanted.
You could have told him if you had wanted.
The first says the needed conversation would now be over and done if he wanted it that way. The implication is that he does not want it that way.
The second says the needed conversation would now be over and done if he had wanted it that way. This implies that he did not want it that way, but leaves open the possibility that he might now want it that way.