An implantable medical device to treat a medical condition in a patient, comprising: an electrical signal generator; at least a first electrode operatively coupled to the electrical signal generator and to a vagus nerve of the patient; a cardiac data sensing module capable of sensing cardiac data from the patient; an unstable brain state declaration module comprising a cardiac module capable of determining at least a first cardiac parameter based upon sensed cardiac data from the patient; characterised in that the cardiac module is further capable of determining at least a second cardiac parameter based upon sensed cardiac data from the patient and / or the unstable brain state declaration module further comprises a non-cardiac parameter detection module capable of detecting at least one non-cardiac parameter; and a value setting module for setting at least a first value with respect to said at least a first cardiac parameter and at least a second value with respect to said at least a second cardiac parameter and / or said at least one non-cardiac parameter to be used by the unstable brain state declaration module; wherein: the unstable brain state declaration module is capable of declaring an unstable brain state of a patient from said at least a first cardiac parameter in combination with said at least a first value and / or said at least a second cardiac parameter and / or said at least one non-cardiac parameter in combination with said at least a second value; the value setting module is capable of adjusting said at least a first value upon declaration of an unstable brain state of a patient from said at least a second cardiac parameter and / or said at least one non-cardiac parameter in combination with said at least a second value. an electrical signal generator; at least a first electrode operatively coupled to the electrical signal generator and to a vagus nerve of the patient; a cardiac data sensing module capable of sensing cardiac data from the patient; an unstable brain state declaration module comprising a cardiac module capable of determining at least a first cardiac parameter based upon sensed cardiac data from the patient; characterised in that the cardiac module is further capable of determining at least a second cardiac parameter based upon sensed cardiac data from the patient and / or the unstable brain state declaration module further comprises a non-cardiac parameter detection module capable of detecting at least one non-cardiac parameter; and a value setting module for setting at least a first value with respect to said at least a first cardiac parameter and at least a second value with respect to said at least a second cardiac parameter and / or said at least one non-cardiac parameter to be used by the unstable brain state declaration module; wherein: the unstable brain state declaration module is capable of declaring an unstable brain state of a patient from said at least a first cardiac parameter in combination with said at least a first value and / or said at least a second cardiac parameter and / or said at least one non-cardiac parameter in combination with said at least a second value; the value setting module is capable of adjusting said at least a first value upon declaration of an unstable brain state of a patient from said at least a second cardiac parameter and / or said at least one non-cardiac parameter in combination with said at least a second value. the unstable brain state declaration module is capable of declaring an unstable brain state of a patient from said at least a first cardiac parameter in combination with said at least a first value and / or said at least a second cardiac parameter and / or said at least one non-cardiac parameter in combination with said at least a second value; the value setting module is capable of adjusting said at least a first value upon declaration of an unstable brain state of a patient from said at least a second cardiac parameter and / or said at least one non-cardiac parameter in combination with said at least a second value.