I don’t think you ruined her by being more of a friend because you were not supported in being a parent. This girl is a product of bad parenting and maybe more her own bad traits.
I would take the violent attacks and threats very seriously and think of her as someone to stay away from for good. I don’t think she’s just a kid in a phase. I’ve seen many cases where violent attacks turn deadly. Consider your own safety first. Even if her father is determined to still have a relationship with her, I would steer clear and exit the picture for my safety if need be.
Maybe you can convince your husband to move away and leave no forwarding address to his daughter and ex. Nothing good is coming of this.
Is there a social worker you can talk to, like for battered women? Although you are not being abused by your husband, you both are being abused by his ex and daughter. She’s nearly adult age. Honestly, I’d preserve myself instead of letting this young criminal kill me.
Prayers for you all.