When mixing your cookie dough, it’s important to use butter at room temperature. Butter that is too warm or melted will similarly prevent your cookies from holding shape at all.
Instead of replacing flour in a recipe haphazardly, consider making a trip to the market for the flour specified. Also, I always recommend using a kitchen scale to measure your flour.
Overmixing your butter and sugar creates a huge risk of cookie spreading. This can result in essentially melted butter that is liquidy instead of creamy.