The past tense of have mastered is had mastered.
The third-person singular simple present indicative form of have mastered is has mastered.
The present participle of have mastered is having mastered.
The past participle of have mastered is had mastered.