Make an ArrayList with players UUID, add them to it if they are in a fight (EntityDamageByEntityEvent) and then after X seconds remove them. You can use a HashMap<UUID, Long> for cooldown. I will leave the research to you.
Konkz I don't think I explained my question very well. What would be needed to check if <player> has hit <player1>. Also thanks for the reply that will help with what I'm attempting to do.