Right. You get yourself trained up to be replaced by an H-1B.
Hasn’t happened yet, knock wood.
Besides in a few years, I’m gone anyway.
Train yourself to be valuable enough that, if replaced by an H1B, not only will the company rapidly regret their decision but in the meanwhile you’ve been able to find another position. Training yourself with different skill sets is great job security, if you can keep it up!
Then you’ll be in a position to negotiate a promotion in both rank and salary. If necessary, you can also negotiate that they get rid of the person who was not able to recognize your value.
Be professional: just do your job so well that management needs you and your co-workers need you. At least once year, you have act like a salesman and point out to management why you are valuable. The rest of the year, work hard (but note I did not say work long hours) and keep up the learning!