I'd treat both things as anxiety symptoms and work on easing anxiety. You might talk to a counselor for ideas about it. I don't think you can treat the symptom (speeches about how much damage she might do to her fingers are just going to make her MORE anxious). Try to figure out what is causing the stress, and try to help her with that.
I bit my nails growing up, i was nervous about something that was going on, My dad at 14 told me he would give me an onyx ring if i could stop biting them for 30 days and i did.. If she is holding her bathroom needs i would sit her down and ask her if it burns when she goes, t could be a urinary tract infection.