How to add directory to cook programatically?

You might be able to add an entry for ‘PrimaryAssetRules’ (in the [/Script/Engine.AssetManagerSettings] section) in the game config file for your plugin and have the CookRule=AlwaysCook for the assets that you always want to cook.