The prosecutor told public defender to tell client "If he needs to sign this plea bargain, because if he doesn't I am going to have him sentenced as a habitual offender"? Can you be threatened into taking a plea bargain?
That kind of threat, yes.
so that is legal?
That kind of threat is legal, yes.