If the value of s3>=5, then add the value of T3 with a cap of 5 if the value of G3>=25
=IF(G3<25,IF(S3>=3,MIN(T3+1,3),"x"),IF(S3>=5,MIN(T3+1,5),"x"))
When you say 'add the value of T3', what are you adding? S3 + T3? Or just putting T3 with a cap of 5 in U3?
Try:
=IF(AND(G3<25,S3>3),S3+IF(T3>3,3,T3),IF(AND(G3<25,S3>3),S3+IF(T3>3,3,T3),"")
=IF(AND(G3>=25,(S3+T3)<=5),S3+T3,IF(AND(G3<25,(S3+T3)<=3),S3+T3,""))