Have you thought of the cough as the cry of a baby? In other words now that she is older, the cough is what the infant uses to get mom in the room? Night light might help, also she may be having an allergic reaction to her bed linens and so on. Try different things if that fails see if it’s acid reflux when she’s lying down. Left side sleeping helps to eliminate that or elevated sleeping.
If she dosent cough during the day, it may be her pillow, blanket or matress.
Let her sleep somewhere else and see whst happens