First, you need to keep removing tiles until you find good secure wallboard that will hold your tiles. I would imagine that all along the tubs lip you will find bad backer board due to water detoriation.
You have to expose two studs so you have something to fasten the new backer board to.
if it was mine and I did not want to do this again, I would go all along the tub and up about 2 feet for good measure. its easier to install larger sheets than little bitty ones. This is your call.
Clean off all the tiles you remove and keep them in order for same order placement on new backer board.
Go to the home center and get cementious backer board, make sure it is the same thickness as the original backer board. If no cementious board, use green board.
Then cut out the new backer board to fit into the hole where there is no old backer board. Screw the new backer to the studs securely. Use many screws.
Now, get your water proof mastic and spread this all over the new backer board and be ready to quickly apply the tiles back on the backer board. When this is done, wait for two days and then grout the job. During the wait, do not allow any water to get on the surface of where your working.
Apply your grout. Seal it in three days.
Caulk around the lip with 100% white silicon caulk. dry for one day.