But until fairly recently you could plead the 5th and they couldn’t use it as proof of wrongdoing.
Unless they were legally obligated to report you. They can testify in regards to whatever specific topic lead to that.
You mean by a court subpoena? If so then you testify or get found in contempt of court.
Or do you mean what if someone is threatened/blackmailed into giving false testimony? If that’s the case then you should probably go to the police. If it’s law enforcement who are coercing you then I suppose you could try to include that fact in the testimony, but there may not be much difference in that and refusing to comply with the blackmailer in the first place, in terms of your safety.
If you’re coerced to lie under oath then I’d guess that still counts as perjury, but I doubt most judges would be mad at you for it; they’d shit fury all over whoever was coercing you.