Change your preferences here.
Reduces target's HP by 1/4 of its max HP, rounded down, at the end of every turn that the target is sleeping. Nightmare's effect ends if the target switches out or wakes up. If the target is put to sleep for a second time, Nightmare's effect does not come back. However, if the target is put to sleep in the same turn that it woke up from an item, the effects continue. Fails if the target is not asleep or is already under this effect.
Nightmare is not a common sight in competitive matches for several reasons. Firstly, it has poor distribution with no real abusers, and secondly, it only works if the foe is asleep, with the effect wearing off if the opponent switches out. Sleep is such a powerful status condition that instead of reserving an entire moveslot for Nightmare you're better off using the free turns that the sleep provides trying to set up a sweep or outright attacking.