export function itemCooldown(player, coolDownName, duration) {
    let coolDown = player.getDynamicProperty('cooldown');
    
    // Initialize cooldown if it doesn't exist
    if (!coolDown) {
        coolDown = '{}';
    }
    
    // Parse the existing cooldown data
    let parsedCooldown;
    try {
        parsedCooldown = JSON.parse(coolDown);
    } catch (error) {
    }
    
    // Update the cooldown value
    parsedCooldown[coolDownName] = duration;
    
    // Save the updated cooldown data
    try {
        const stringifiedCooldown = JSON.stringify(parsedCooldown);
        player.setDynamicProperty('cooldown', stringifiedCooldown);
    } catch (error) {
    }
}
