You don’t provide the details of the error which tells you exactly which line it is on etc. If your reference isn’t set to an object you can then look at where you think you’re setting it.
MeleeEnemyLogic MEL = GetComponent<MeleeEnemyLogic>();
This isn’t valid. You should define this here but assign this in the “Start” method.
MeleeEnemyLogic MEL;
// Start is called before the first frame update
void Start()
{
MEL = GetComponent<MeleeEnemyLogic>();
enemycurrentHealth = enemymaxHealth;
}
Also please use code-tags when posting code and not plain-text.